"); parent.frames[0].document.close(); } function setCookie(name,value,minuti) { var expdate= new Date(); /* data di scadenza */ value+="#"; /* fine cookie */ expdate.setTime(expdate.getTime()+(60000*minuti)); document.cookie = name+"="+escape(value)+"; expires="+expdate.toGMTString(); } function getCookie(name) { var arg; var alen; var clen = document.cookie.length; var i=0,j,k; var valore; arg = name + "="; alen=arg.length while (i1) msg+=nc+" right and "; if (nc==1) msg+=" only one exact and "; if (nc==0) msg+=" nothing exact and "; if (ns>1) msg+=ns+" wrong."; if (ns==1) msg+=" only one wrong."; if (ns==0) msg+=" nothing wrong."; msg+=" You must answer to "; if (nr>1) msg+=nr+" questions."; else msg+=" one question."; window.status=msg; } function getHTMLTagSound(soundFile) { var tagSound = ""; if (parent.pluginInstalled("Crescendo")) { if (parent.getBrowser()=="NS") { if (parent.getBrowserVers()==2) { tagSound = ''; } } else { if (parent.getBrowser()=="NS") { tagSound = '\n"); if (linkback!="") { documento.writeln(""); } documento.writeln("
\n"); documento.write("" + linkname+"\n"); documento.writeln("PRINT | \n"); if (man_repeat) documento.writeln("REPEAT | \n"); if (topChartFile!='') documento.writeln("Top Chart | \n"); documento.writeln("QUIT\n"); documento.writeln("

\n"); } function PrintQuizResults(doc) { var deltatime = time - oldtime; var name; doc.writeln("\n"); if ((showReport==1)&&(dhtmlEnabled==1)) { doc.writeln("
\n"); doc.writeln("\n"); doc.writeln("
Quiz Result\n"); doc.writeln("PRINT | \n"); if (man_repeat) doc.writeln("REPEAT | \n"); if (topChartFile!='') doc.writeln("Top Chart | \n"); doc.writeln("QUIT\n"); doc.writeln("

\n"); } doc.writeln("
"); doc.writeln("
"); doc.writeln(""); doc.writeln(" "); if (identityName!="") { doc.writeln(""); doc.writeln(" "); } doc.writeln(""); doc.writeln(" "); doc.writeln(""); doc.writeln(" "); doc.writeln(""); doc.writeln(" "); if (maxtime>0) { doc.writeln(""); doc.writeln(" "); } doc.writeln(""); doc.writeln(" "); doc.writeln(""); if (computeMarkErr==0) doc.writeln(" "); else doc.writeln(" "); doc.writeln("
"); doc.writeln(""); doc.writeln("
"+parent.quizTitle+"
  Number of questions :     "+(questions-invisibleQuests)+"  
  Candidate name     "+identityName+"  
  Right Answers    "+nc+"  
  Wrong Answers    "+ns+"  
  Unmarked questions :     "+falseQuests+"  
  Time elapsed :     "+getTimeString(deltatime)+"  
  Date :     "+parent.DataToStringa()+"  
  MARK    "+voto+"/"+maxvoto+"  
  No mark  
"); } function checkRisposta(checkBox,risp,n) { if ( ((checkBox.checked==true) && (parent.isRightAns(n,risp)==1)) || ((checkBox.checked==false) && (parent.isRightAns(n,risp)==0)) ) return 1; return 0; } function checkRispostaBooleana(radioBox,risp,n) { if ( ((radioBox[0].checked==true) && (risp[n]==1)) || ((radioBox[1].checked==true) && (risp[n]==0)) ) return 1; return 0; } function checkTrueOrFalse(radioBox) { if ( (radioBox[0].checked==false) && (radioBox[1].checked==false)) return 0; return 1; } function IncompletedQuest() { window.alert("The answer is incompleted. Please, choose all the items"); } function AnsReport(choice,value,rem,data) { this.choice = choice; this.valuation = value; this.remark = rem; this.data = data; } function getListOfRightAns(n) { var j,value,msg=''; 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;j0)&&(choice==1)) || ((value<0)&&(choice==0))) return 1; return 0; } function getScore(n) { var j,choice,value,data, score=0,nchoice=0; for (j=0;j=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 getGuessFillGapN(n,m) { var i,j,value,choice; var str1,str2; choice = allAnsReport[n][m].choice; value = allAnsReport[n][m].valuation; str1 = trim(choice.toLowerCase()); for (i=0; i
"); for (k=0;k\n"); } if ((k==0)&&(ncols_report>=2)) { documento.writeln("
\n"); } if ((k==half_index)&&((ncols_report==2)||(ncols_report==4))) { documento.writeln(""); } if (ncols_report==3) { if ((k==index13)||(k==index23)) { documento.writeln(""); } } if (ncols_report==4) { if ((k==index14)||(k==index34)) { documento.writeln(""); } } i = ordineDomande[k]; if (valid[i]==4) continue; documento.writeln(""+n+" "+qstHead[i]+"
"); n++; documento.writeln(""); if (valid[i]==1) documento.writeln("Correct answer
"); else if (valid[i]==-1) documento.writeln("Wrong answer
"); else if (valid[i]==2) documento.writeln("Question not valuated
"); else if (valid[i]==3) { if (typeOfQuest[i]==2) documento.writeln("Right sentences "+nScore[i]+" on "+maxScore[i]+"
"); else if (typeOfQuest[i]==4) documento.writeln("Guess words "+nScore[i]+" on "+maxScore[i]+"
"); else if (typeOfQuest[i]==5) documento.writeln("Matching "+nScore[i]+" on "+maxScore[i]+"
"); } else if (valid[i]==5) { documento.write("scores "+nScore[i]); if (groups[i]==0) documento.writeln(" (MARK "+maxScore[i]+")
"); else if (groups[i]==1) documento.writeln("
Scores added with the previous question
"); else if (groups[i]==2) documento.writeln("
MARK (computes from the sum of scores of next questions): "+maxScore[i]+"
"); } documento.writeln("
"); if (valid[i]==2) { documento.write("

"+allAnsReport[i][0].choice+"

"); continue; } documento.writeln("
"); documento.writeln(""); for (j=0;j"); else documento.write(" "); documento.write(""); choice = allAnsReport[i][j].choice; if (typeOfQuest[i]==2) { documento.write(""); else documento.write(""); documento.write(""); else documento.write(""); } else if (typeOfQuest[i]==4) { if (getGuessFillGapN(i,j)) documento.write(""); else { documento.write(""); else if (m==0) { documento.write(""); else documento.write(""); } documento.writeln(""); } documento.writeln("
"); documento.write(Lettera(j)); documento.write(" V "); if (choice==1) documento.write(" F "); if (choice==0) documento.write(""+choice+""+choice+" "); for (l=0; l"); } } else if (typeOfQuest[i]==5) { m = getGuessMatchN(i,j); if (m==1) documento.write(""+choice[0]+" - "+choice[1]+""+choice[0]+" - "); documento.write(""+choice[1]+""); documento.write(" "); for (l=0; l"); } else { documento.write(""+choice[0]+" - "+choice[1]+""); } } else { if (choice==1) documento.write(""); if (valid[i]==5) { value = allAnsReport[i][j].valuation; data = allAnsReport[i][j].data; documento.write(" ("+value+") "); if (data!=0) documento.write(" ("+data+") "); } if (choice==1) documento.write(allAnsReport[i][j].remark); documento.writeln("

"); } documento.writeln("
"); } function init_IntArray(n) { var i; this.length=n; for (i=0; i"); doc.writeln(""); doc.writeln(""); doc.writeln(""); doc.writeln(""); } } function getSelezione(obj) { 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; } } var okIcon = "smiling.html"; var koIcon = "no.html"; var warnIcon = "warn.html"; var checkIcon = "check.html"; function VerifyBrowser() { var msg; var status; if (! ((getBrowser()=='IE')&&(getBrowserVers()>=4))) { msg = "The browser "+navigator.appName+" "+navigator.appVersion; msg+= "couldn't view exactly this quiz. Continue ?"; if (!window.confirm(msg)) top.close(); } } function Timer() { var delta; if (ctmnow) { clearTimeout(ctmnow); ctmnow=0; } cnewdt = new Date(); time = Math.floor(cnewdt.getTime()/1000); delta = maxtime-(time-oldtime); if ((end_test==0)&&(oldtime!=time)) SetClock(getTimeString(delta)); if ((delta<=0)&&(end_test==0)) { window.alert("The time is over!"); end_test=1; EndQuiz(); } ctmnow=setTimeout("Timer()",1000); } function getHTMLResultEmbed(nomeIco,title,titleColor,bodyMsg,n) { var msg; msg = "
"; msg += ""; msg += title + "

"; if (bodyMsg!="") msg += "" + bodyMsg + "
"; msg += ""; return msg; } function getHTMLResultWin(nomeIco,title,titleColor,bodyMsg) { var msg; msg = "
"; msg += ""; msg += title + "

"; if (bodyMsg!="") msg += "" + bodyMsg + "
"; msg += "
"; } } return getHTMLResultBox(okIcon,"Good ! Right answer","#000080",msg,n); } function getWrongAnswer(n,explan) { var i,title,msg=""; title = "Wrong!
The correct answer was " + getListOfRightAns(n); for (i=0;i"; } } return getHTMLResultBox(koIcon,title,"#A52A2A",msg,n); } function getQuestionScore(n) { var i,title,msg=""; var nomeIcona; if (maxScore[n]==maxvoto) nomeIcona = okIcon; else if (maxScore[n]==minvoto) nomeIcona = koIcon; else nomeIcona = warnIcon; title = "Score " + nScore[n]; if (groups[n]==0) title += " / MARK " + maxScore[n]; if (getGuessAns(n)"); parent.frames[0].document.writeln("
Watch out!
"); parent.frames[0].document.writeln ("The keyword isn't correct
"); parent.frames[0].document.writeln ("Unable to continue the quiz
"); parent.frames[0].document.writeln ("For information, contact the quiz's author
"); parent.frames[0].document.writeln("

"); parent.frames[0].document.writeln("

"); parent.frames[0].document.writeln ("



"); parent.frames[0].document.close(); PrintCopyright(); } function PrintNoReload() { parent.frames[0].document.clear(); parent.frames[0].document.open(); PrintOpenHTML(0,"",1); parent.frames[0].document.writeln ("

"); parent.frames[0].document.writeln("


Watch out!
"); parent.frames[0].document.writeln ("Reload of quiz is not allowed
"); parent.frames[0].document.writeln ("Unable to start the quiz
"); parent.frames[0].document.writeln ("For information, contact the quiz's author
"); parent.frames[0].document.writeln("

"); parent.frames[0].document.writeln("

"); parent.frames[0].document.writeln ("



"); parent.frames[0].document.close(); PrintCopyright(0); } function PrintResults() { parent.frames[0].document.close(); parent.frames[0].document.clear(); parent.frames[0].document.open(); PrintOpenHTML(0,"Quiz Result",0); parent.frames[0].document.writeln("\n"); parent.frames[0].document.writeln(""); parent.frames[0].document.writeln("

"); if (valutaQuiz==1) { PrintQuizResults(parent.frames[0].document); if (showReport==1) PrintReport(parent.frames[0].document); PrintLinkBack(parent.frames[0].document); } else { parent.frames[0].document.writeln("

"); parent.frames[0].document.writeln(finalMess); parent.frames[0].document.writeln("
"); PrintLinkBack(parent.frames[0].document); } parent.frames[0].document.writeln ("



"); parent.frames[0].document.close(); window.status = ""; } function PrintCopyright() { parent.frames[1].document.clear(); parent.frames[1].document.open(); PrintOpenHTML(1,"Info",0); parent.frames[1].document.writeln(""); parent.frames[1].document.writeln (""); parent.frames[1].document.writeln ("

"); if (printCpRg==1) { parent.frames[1].document.writeln("
"); parent.frames[1].document.writeln(""); parent.frames[1].document.writeln("This quiz was created "); if (parent.author!='') parent.frames[1].document.writeln("by "+parent.author+" "); parent.frames[1].document.writeln("with "+qmakeProgName+" "+qmakeVers+""); parent.frames[1].document.writeln ("
"); } parent.frames[1].document.writeln ("



"); parent.frames[1].document.close(); } function PlaySoundBooleanAns(n) { if (nScore[n]==maxScore[n]) PlaySoundFile(okSound); else if (nScore[n]==0) PlaySoundFile(errSound); else PlaySoundFile(warnSound); } function PlaySoundWithScore(voto) { if (voto==maxvoto) PlaySoundFile(okSound); else if (voto==minvoto) PlaySoundFile(errSound); else PlaySoundFile(warnSound); } function PlaySoundFile(soundFile) { parent.frames[2].document.clear(); PrintOpenHTML(2,"",1); parent.frames[2].document.writeln ("

"); parent.frames[2].document.writeln (""); parent.frames[2].document.writeln ("



"); parent.frames[2].document.close(); } var lastLayer = null; function showTooltip (thisLayer) { parent.frames[0].document.all(thisLayer).className = "tooltipShow"; } function clearTooltip (thisLayer) { if (lastLayer!=null) deleteTooltip (); lastLayer = thisLayer; setTimeout(deleteTooltip,2000); } function deleteTooltip () { if (lastLayer != null) parent.frames[0].document.all(lastLayer).className = "tooltipHide"; lastLayer = null; } function RepeatQuiz() { n_repeat++; parent.frames[1].location.href = filename + '3.htm'; if (!questSlide) { parent.frames[0].location.href = filename + '1.htm'; } else { parent.frames[0].location.href = filename + 'Q1.htm'; } } function AskPrintQuiz() { var i; if (window.confirm("Print quiz ?")) { if (questSlide==0) { for (i=0; i=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 (nr==0) return 1; return 0; } function EndQuiz() { completeInitValuate(); } function FinalActions() { voto = ComputeMarks(); SendResults(); PrintResults(); PrintCopyright(1); } function SetClock(timeStr) { parent.frames[1].document.all.clock.innerText = timeStr; } function init_valid() { for (var i=0;i'); parent.frames[nframe].document.writeln (' '); parent.frames[nframe].document.writeln (""+title+""); parent.frames[nframe].document.writeln (""); if (closeHead==1) parent.frames[nframe].document.writeln (''); } //--> Browser with no frames-enabled option