L299 โ Il Futuro della Lingua Italiana
C2 ยท Prospettive globali per l’italiano nel XXI secolo
C2
In this lesson you will learn key Italian vocabulary for c2 ยท prospettive globali per l’italiano nel xxi secolo. Practice reading, listening, speaking and writing!
var ml2xp=0,ml2hearts=3,ml2step=0;function ml2upd(){document.getElementById(“ml2-xp”).textContent=ml2xp+” XP “+”โฅ”.repeat(ml2hearts)+”โก”.repeat(3-ml2hearts)}function ml2go(n){if(ml2step===n)return;document.getElementById(“ml2-step”+ml2step).style.display=”none”;ml2step=n;var el=n===”done”?document.getElementById(“ml2-done”):document.getElementById(“ml2-step”+n);if(el)el.style.display=”block”;window.scrollTo(0,0)}function ml2mc(btn,ans){if(btn.disabled)return;Array.from(document.querySelectorAll(“#ml2-opts button”)).forEach(function(b){b.disabled=true});var ok=btn.textContent.trim().includes(ans);btn.style.background=ok?”#d4edda”:”#f8d7da”;btn.style.borderColor=ok?”#28a745″:”#dc3545″;var fb=document.getElementById(“ml2-fb1″);fb.style.display=”block”;if(ok){ml2xp+=10;fb.innerHTML=”
“;}else{if(ml2hearts>0)ml2hearts–;fb.innerHTML=”
“;}ml2upd();setTimeout(function(){ml2go(2)},1400)}function playAudio(t){var u=new SpeechSynthesisUtterance(t);u.lang=”it-IT”;u.rate=0.85;window.speechSynthesis.speak(u)}function startSpeak(phrase){var SR=window.SpeechRecognition||window.webkitSpeechRecognition;if(!SR){document.getElementById(“ml2-srfb”).textContent=”โ Mic not supported”;return}var r=new SR();r.lang=”it-IT”;r.start();r.onresult=function(e){var said=e.results[0][0].transcript.toLowerCase().trim();var exp=phrase.toLowerCase().trim();var ok=levenshtein(said,exp)<=2||said.includes(exp.split(” “)[0]);if(ok){ml2xp+=15;document.getElementById(“ml2-srfb”).innerHTML=”
“;ml2upd();setTimeout(function(){ml2go(4)},1200)}else{if(ml2hearts>0)ml2hearts–;document.getElementById(“ml2-srfb”).innerHTML=”
“;ml2upd()}};r.onerror=function(){document.getElementById(“ml2-srfb”).textContent=”โ Could not hear.”}}function chkWrite(ans){var v=(document.getElementById(“ml2-wi”).value||””).trim().toLowerCase();var ok=levenshtein(v,ans.toLowerCase())<=2;var fb=document.getElementById(“ml2-wfb”);if(ok){ml2xp+=20;fb.innerHTML=”
“;ml2upd();setTimeout(function(){ml2go(“done”)},1200)}else{if(ml2hearts>0)ml2hearts–;fb.innerHTML=”
“;ml2upd()}}function levenshtein(a,b){var m=a.length,n=b.length,d=[];for(var i=0;i<=m;i++)d[i]=[i];for(var j=0;j<=n;j++)d[0][j]=j;for(var i=1;i<=m;i++)for(var j=1;j<=n;j++)d[i][j]=a[i-1]===b[j-1]?d[i-1][j-1]:1+Math.min(d[i-1][j],d[i][j-1],d[i-1][j-1]);return d[m][n]}ml2upd();


Leave a Reply