'; var bodyTagFrame2=''; var noBorderBodyTagFrame2=''; var soundEnable = 0; var okSound=''; var errSound=''; var warnSound=''; var valid = new init_array(6); var nScore = new init_array(6); var maxScore = new init_array(6); var questions=6; var qstHead = new init_array(6); var pageWidth = 80; var groups = new init_array(0,0,0,0,0,0); var quizTitle="Decide if the verbs in the sentence are right or wrong"; var maxtime=900; var keycode = new init_array(4); var keyword = 'syskey'; MakeKeyCode(); var los = 0; var maxvoto = 10; var minvoto = 0; var roundvoto = 1; var voto = 0; var silent = 0; var quizRetire = 0; var showReport = 1; var ncols_report = 1; var valutaQuiz = 1; var falseQuests = 0; var invisibleQuests = 0; var auto_repeat = 1; var man_repeat = 0; var n_repeat = 0; var reviewQuiz = 0; var markPercentage = 1; var max_repeat = 2; var min_mark_repeat = 6; var finalMess = ''; var printCpRg=1; var filename = 'exer'; var topChartFile=''; var pesi = new init_array(6); var allAnsReport = new init_array(6); var author = ''; var mediaDir = 'media'; var questSlide = 0; var lockRightAns = 0; var resultBoxKind = 0; var reportNotation = 2; var remRepAlways = 1; var confirmEachQst = 1; var isResultsPageDark = 0 var ordineDomande = new init_array(0,1,2,3,4,5); var typeOfQuest = new init_array(1,1,1,1,1,1); var omitPoint = new init_array(0,0,0,0,0,0); var nc=0, ns=0, nr; var end_test=0; var userName=""; var identityName=""; var computeMarkErr = 0; var okIcon = "smiling.gif"; var koIcon = "no.gif"; var warnIcon = "warn.gif"; var checkIcon = "check.gif"; function setCookie(cookie_name,cookie_value,minuti) { var expdate= new Date(); cookie_value+="#"; expdate.setTime(expdate.getTime()+(60000*minuti)); document.cookie = cookie_name+"="+escape(cookie_value)+"; expires="+expdate.toGMTString(); } function getCookie(cookie_name) { var arg; var alen; var clen = document.cookie.length; var i=0,j,k; var valore; arg = cookie_name + "="; alen=arg.length while (i'; } } else { if (getBrowser()=="NS") { tagSound = ''; } } return tagSound; } function PlaySound(suonoObj) { if (soundEnable==0) return; if (navigator.appName == 'Netscape') { if (parseInt(navigator.appVersion) >= 3) { suonoObj.play(false); if (navigator.javaEnabled()) { if (navigator.mimeTypes['audio/midi'] != null) { if (navigator.mimeTypes['audio/midi'].enabledPlugin != null) { suonoObj.play(false); } else alert('Your browser does not have a plug-in to play audio/midi mime types!'); } else alert('Your browser does not support the audio/midi mime type!'); } else alert('Requires Java enabled to be enabled'); } else alert('Only works in Netscape Navigator 3 or greater'); } else { suonoObj.play(); } } var dlgList = new init_array(10); var nDlgs = 0; function MyDialog(dlgId,filename,x,y) { this.dlgId = dlgId; this.filename = filename; this.x = x; this.y = y; this.opened = 0; this.handle = 0; } function CreateDialog(dlgId,filename,x,y) { var my_dialog; var i,found=0; for (i=0; i=0; i--) { if (str.charAt(i)!=' ') break; } iStop = i; if ((iStart!=0)||(iStop!=str.length-1)) return str.substring(iStart,iStop+1); return str; } function rand(n) { return Math.floor(Math.random()*n); } function DataToStringa() { var obj = new Date(); var mese,giorno; var nome=""; var stringa=""; var strData; giorno = obj.getDay(); switch(giorno) { case 0: nome = "Sunday"; break; case 1: nome = "Monday"; break; case 2: nome = "Tuesday"; break; case 3: nome = "Wednesday"; break; case 4: nome = "Thursday"; break; case 5: nome = "Friday"; break; case 6: nome = "Saturday"; break; } strData = nome+", "+obj.getDate(); mese = obj.getMonth(); switch(mese) { case 0: nome = "January"; break; case 1: nome = "February"; break; case 2: nome = "March"; break; case 3: nome = "April"; break; case 4: nome = "May"; break; case 5: nome = "June"; break; case 6: nome = "July"; break; case 7: nome = "August"; break; case 8: nome = "September"; break; case 9: nome = "October"; break; case 10: nome = "November"; break; case 11: nome = "December"; } strData += " "+nome+" "+obj.getYear(); strData += " - "; if (obj.getHours()<10) strData += "0" + obj.getHours(); else strData += obj.getHours(); strData += ":"; if (obj.getMinutes()<10) strData += "0" + obj.getMinutes(); else strData += obj.getMinutes(); strData += ":"; if (obj.getSeconds()<10) strData += "0" + obj.getSeconds(); else strData += obj.getSeconds(); return strData; } function getBrowserVers() { return parseInt (navigator.appVersion.charAt(0)); } function getBrowser() { if (navigator.appName=="Netscape") return "NS"; if (navigator.appName=="Microsoft Internet Explorer") return "IE"; return ""; } function pluginInstalled(str) { var i; for (i=0; i255)) return "NULL"; car = '%'+dec_to_hex(n); return unescape(car); } function DecodeString(msg) { var i,j,n; var decode_msg=""; var num; var car; n = keyword.length; j=0; for(i=0;i127)) { PrintWrongKeyword(); return ""; } car = '%'+dec_to_hex(num); decode_msg+=unescape(car); j++; } return decode_msg; } function DecodeNumber(i,n,minNum,maxNum) { var num,lung; lung = keyword.length; num=i-keycode[n%lung]; if ((nummaxNum)) PrintWrongKeyword(); return num; } function CodeString(msg) { var i,n; var code_msg=""; var c=0; n = keyword.length; for (i=0;i127) c = 127 + keycode[i%n]; else c = ASCIItoInt(msg.charAt(i)) + keycode[i%n]; if (c<10) code_msg += " "+c; else if (c<100) code_msg += " "+c; else code_msg += ""+c; } return code_msg; } function MakeKeyCode() { var i,num; var car; for (i=0;i='a')&&(car<='z')) { keycode[i]=num-97; continue; } if ((car>='A')&&(car<='Z')) { keycode[i]=num-65; continue; } keycode[i]=0; } } function AnsReport(choice,value,rem,data,answer) { this.choice = choice; this.valuation = value; this.remark = rem; this.data = data; this.answer = answer; } function doValuate(n) { if (typeOfQuest[n]==1) doValuateMultiAns(n); else if (typeOfQuest[n]==101) doValuateWithPoints(n); else if (typeOfQuest[n]==2) doValuateBoolAns(n); else if (typeOfQuest[n]==3) doValuateOpenAns(n); else if (typeOfQuest[n]==4) doValuateFillGap(n); else if (typeOfQuest[n]==5) doValuateMatching(n); } function doValuateMultiAns(n) { nScore[n] = getGuessAns(n); maxScore[n] = getNumAns(n); if (nScore[n]==maxScore[n]) valid[n]=1; else valid[n]=-1; } function doValuateWithPoints(n) { nScore[n] = getScore(n); maxScore[n] = ConvertPointToMark(n,nScore[n]); valid[n]=5; } function doValuateBoolAns(n) { nScore[n] = getGuessAns(n); maxScore[n] = getNumAns(n); if (nScore[n]==maxScore[n]) valid[n]=1; else if (nScore[n]==0) valid[n]=-1; else valid[n]=3; } function doValuateFillGap(n) { nScore[n] = getGuessFillGap(n); maxScore[n] = getNumAns(n); if (nScore[n]==maxScore[n]) valid[n]=1; else if (nScore[n]==0) valid[n]=-1; else valid[n]=3; } function doValuateMatching(n) { nScore[n] = getGuessMatch(n); maxScore[n] = getNumAns(n); if (nScore[n]==maxScore[n]) valid[n]=1; else if (nScore[n]==0) valid[n]=-1; else valid[n]=3; } function doValuateOpenAns(n) { nScore[n] = 0; maxScore[n] = 0; valid[n] = 2; } function getGuessAns(n) { var j,guess=0; for (j=0;j0)&&(choice==1)) || ((value<0)&&(choice==0))) return 1; return 0; } function getGuessMatch(n) { var j,guess=0; for (j=0;j0) msg += Lettera(j)+' '; } return msg; } function getNumOfRightAns(n) { var j,value,num=0; for (j=0;j0) num++; } return num; } function getListOfSelAns(n) { var j,value,msg=''; if (typeOfQuest[n]==3) { return allAnsReport[n][0].choice; } for (j=0;j=60) nc++; else ns++; } else if (valid[i]==5) { ratio = 100 * maxScore[i] / maxvoto; if (ratio>=60) nc++; else ns++; } if (valid[i]!=0) nr--; if ((valid[i]==2)||(valid[i]==4)) nexcl++; } if ((questSlide==1)&&(lockRightAns==1)) { if (nc + nexcl == questions) return 1; } else { if (nr==0) return 1; } return 0; } var ctmnow=0,cnewdt; var time,oldtime; function StartTime() { var data,sec; data = new Date(); sec = Math.floor(data.getTime()/1000); return sec; } function getTimeString(deltatime) { var resto,h,m,s; var str; h = Math.floor(deltatime/3600); resto = deltatime%3600; m = Math.floor(resto/60); s = resto%60; if (h<10) h='0'+h; if (m<10) m='0'+m; if (s<10) s='0'+s; str = h+":"+m+":"+s; return str; } function determinaOrdineIniziale(nvett) { var i,count,n; var nuovoPezzo; this.length=nvett; for (i=0; i"); if (lockLeftCol==0) doc.writeln(""); for (i=0; i"+lista1[ordine1[i]]); else doc.writeln("