var qmakeVers = '2.12.2';
var qmakeProgName = "Galli's QuizFaber";
var qmakeURL = 'www.lucagalli.net/';
var dhtmlEnabled = 0;
var frameEnabled = 0;
var bodyTagFrame1='<BODY BACKGROUND="media/" BGCOLOR="#FFFFFF" TEXT="#000000">';
var bodyTagFrame2='<BODY BACKGROUND="media/" BGCOLOR="#FFFFFF" TEXT="#000000">';
var noBorderBodyTagFrame2='<BODY BACKGROUND="media/" BGCOLOR="#FFFFFF" TEXT="#000000" TOPMARGIN="0" LEFTMARGIN="0" marginheight="0" marginwidth="0">';
var soundEnable = 0;
var okSound='';
var errSound='';
var warnSound='';
var valid;
var nScore;
var maxScore;
var questions=100;
var qstHead;
var pageWidth = 80;
var groups;
var quizTitle="ecgvrtest01";
var maxtime=5400;
var showTimeout = 1;
var keycode;
var keyword = 'syskey';
var los = 0;
var maxvoto = 100;
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 = 0;
var man_repeat = 1;
var n_repeat = 0;
var reviewQuiz = 0;
var markPercentage = 1;
var incl_close_btn = 0;
var incl_print_btn = 1;
var incl_linkback = 0;
var finalMess = '';
var printCpRg=1;
var filename = 'ecgvrtest01';

var topChartFile='';
var pesi;
var allAnsReport;
var author  = 'D.Sclias';
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 compressReport = 0
var ordineDomande;
var typeOfQuest;
var omitPoint;
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 setTempCookie(cookie_name,cookie_value,minuti)
{
document.cookie = cookie_name+"="+escape(cookie_value+"#");
}
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<clen) {
j = i+alen;
if (document.cookie.substring(i,j)==arg)  {
k = document.cookie.indexOf(escape("#"),j);
valore = unescape(document.cookie.substring(j,k));
return valore;
}
i = document.cookie.indexOf(" ",i)+1;
if (i==0) break;
}
return "";  
}
function getHTMLTagSound(soundFile)
{
var tagSound = "";
if (pluginInstalled("Crescendo"))
{
if (getBrowser()=="NS") {
if (getBrowserVers()==2) {
tagSound = '<EMBED SRC="'+soundFile+'" ';
tagSound += 'HEIGHT=2 WIDTH=0 ';
tagSound += 'loop="true" autostart="TRUE">';
}
else {
tagSound = '<EMBED TYPE="music/crescendo" ';
tagSound += 'SONG="'+soundFile+'" ';
tagSound += 'PLUGINSPAGE="www.liveupdate.com/dl.html" ';
tagSound += 'loop="true" autostart="TRUE" ';
tagSound += 'HEIGHT=2 WIDTH=0></EMBED>';
}
}
if (getBrowser()=="IE") {
tagSound = '<OBJECT ID=Crescendo ';
tagSound += 'CLASSID="clsid:0FC6BF2B-E16A-11CF-AB2E-0080AD08A326" ';
tagSound += 'HEIGHT=2 WIDTH=0> ';
tagSound += '<PARAM NAME="Song" VALUE="'+soundFile+'"></OBJECT>';
}
}
else { 
if (getBrowser()=="NS") {
tagSound = '<EMBED SRC="'+soundFile+'" ';
tagSound += 'HEIGHT=15 loop=yes autostart=true>';
}
else if (getBrowser()=="IE") {
tagSound = '<BGSOUND src="'+soundFile+'" loop=infinite>';
}
}
return tagSound;
}
function PlaySound(suonoID)  {
if (soundEnable==0)
return;
var thissound=document.getElementById(suonoID);
if (thissound!=null) {
thissound.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<nDlgs; i++) {
if (dlgList[i].dlgId==dlgId) { found=1; break; }
}
if (found==0) {
my_dialog = new MyDialog(dlgId,filename,x,y);
dlgList[nDlgs] = my_dialog;
nDlgs++;
}
else {
my_dialog = dlgList[i];
}
return my_dialog;
}
function ManageDialog(myDialog) {
var handle;
var mode = '';
dlgId = 'my'+myDialog.filename;
if (myDialog.opened==0) {
mode = 'menubar=no,status=no,location=no';
mode += ',width='+myDialog.x;
mode += ',height='+myDialog.y;
handle = window.open(myDialog.filename,myDialog.dlgId,mode);
myDialog.handle = handle;
myDialog.opened = 1;
}
else {
handle = myDialog.handle;
}
return handle;
}
function UnmanageDialog(dlgId) {
var i;
for (i=0; i<nDlgs; i++) {
if (dlgList[i].dlgId==dlgId) {
if (dlgList[i].opened==1) {
dlgList[i].handle.close();
dlgList[i].opened = 0;
break;
}
}
}
}
function UnmanageAllDialogs() {
var i;
for (i=0; i<nDlgs; i++) {
UnmanageDialog(dlgList[i].dlgId);
}
}
function init_array()
{
this.length = init_array.arguments.length;
for (var i=0;i<this.length;i++)
this[i]=init_array.arguments[i];
}
function init_IntArray(n,value) {
var i;
this.length=n;
for (i=0; i<n; i++)
this[i]=value;
}
function initOneElementVector() {
this.length=1;
}
function dec_to_hex(str_dec)
{
var H=0,L=0;
var S="";
var dec=0;
dec = eval(str_dec);
H=Math.floor(dec/16);
L=dec%16;
S+=valore_hex(H);
S+=valore_hex(L);
return S;
}
function hex_to_dec(hex)
{
var d=0,H=0,L=0;
H=valore_dec(hex.charAt(0));
L=valore_dec(hex.charAt(1));
d=H*16+L;
return d;
}
function valore_dec(c)
{
var n=0;
if (c<='9') n=eval(c);
if ((c=='A')||(c=='a')) n=10;
if ((c=='B')||(c=='b')) n=11;
if ((c=='C')||(c=='c')) n=12;
if ((c=='D')||(c=='d')) n=13;
if ((c=='E')||(c=='e')) n=14;
if ((c=='F')||(c=='f')) n=15;
return n;
}
function valore_hex(n)
{
if (n<=9) return n;
if (n==10) return 'A';
if (n==11) return 'B';
if (n==12) return 'C';
if (n==13) return 'D';
if (n==14) return 'E';
if (n==15) return 'F';
}
function Lettera(cc)
{
var c,chr=65;
var a=0,b=0;
if (cc<=25) {
chr+=cc;
c = unescape("%"+dec_to_hex(chr));
}
else {
a = Math.floor(cc / 26);
b = cc % 26;
chr+=b;
c = unescape("%"+dec_to_hex(chr));
c = "" + a + c;
}
return c;
}
function trim(str) {
var i,iStart,iStop;
for (i=0; i<str.length; i++) {
if (str.charAt(i)!=' ')
break;
}
iStart = i;
for (i=str.length-1; 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 SetInnerText(obj,text)
{
if(document.all) {
obj.innerText = text;
} 
else {
obj.textContent = text;
} 
}
function getBrowserVers()
{
return parseInt (navigator.appVersion.charAt(0));
}
function getBrowser()
{
var appVers = navigator.appVersion;
if (navigator.appName=="Netscape") {
if ((appVers.indexOf("Safari")!=-1)&&(appVers.indexOf("Chrome")==-1)) {
	 return "SF";  
}
else if (appVers.indexOf("Chrome")!=-1) {
	 return "CR";  
}
return "NS";  
}
else if (navigator.appName=="Microsoft Internet Explorer") {
return "IE";
}
else if (navigator.appName=="Opera") {
return "OP";
}
return "";
}
function pluginInstalled(str)
{
var i;
for (i=0; i<navigator.plugins.length; i++) {
if (navigator.plugins[i].name.indexOf(str) != -1)
return true;
}
return false;
}
function ASCIItoInt(c)
{
var i,car;
for (i=32;i<256;i++) {
car = '%'+dec_to_hex(i);
if (c==unescape(car))
return i;
}
return 0;
}
function InttoASCII(n)
{
var car;
if ((n<0)||(n>255))
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;i<msg.length;i+=3) {
num = eval(msg.substring(i,i+3))-keycode[j%n];
if ((num<32)||(num>127)) {
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 ((num<minNum)||(num>maxNum))  
PrintWrongKeyword();
return num;
}
function CodeString(msg)
{
var i,n;
var code_msg="";  
var c=0;
n = keyword.length;
for (i=0;i<msg.length;i++) {
if (ASCIItoInt(msg.charAt(i))<32) 
c = 32 + keycode[i%n];
else if (ASCIItoInt(msg[i])>127) 
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;
keycode = new init_IntArray(keyword.length,0);
for (i=0;i<keyword.length;i++) {
car = keyword.charAt(i);
num = ASCIItoInt(car);
if ((car>='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;j<allAnsReport[n].length;j++) {
if (getGuessAnsN(n,j)) guess++;
}
return guess;
}
function getGuessAnsN(n,m)
{
var value,choice,data;
value  = allAnsReport[n][m].valuation;
choice = allAnsReport[n][m].choice;
data   = allAnsReport[n][m].data;
value += data;
if (((value>0)&&(choice==1)) || ((value<0)&&(choice==0)))
return 1;
return 0;
}
function getGuessMatch(n)
{
var j,guess=0;
for (j=0;j<allAnsReport[n].length;j++) {
if (getGuessMatchN(n,j)==1) guess++;
}
return guess;
}
function getGuessMatchN(n,m)
{
var i,j,value,choice;
var str1,str2,str3;
value  = allAnsReport[n][m].valuation;
choice = allAnsReport[n][m].choice;
str1 = choice[0] + choice[1];
for (i=0; i<value.length; i++) {
str2 = choice[0] + value[i];
if (str1.toString().toLowerCase()==str2.toString().toLowerCase()) {
for (j=0; j<allAnsReport[n].length; j++) {
str3 = allAnsReport[n][j].choice[0] + allAnsReport[n][j].choice[1];
if (str1.toString().toLowerCase()==str3.toString().toLowerCase()) {
if (j==m)
return 1; 
else
return -1; 
}
}
}
}
return 0;
}
function getGuessFillGap(n)
{
var j,guess=0;
for (j=0;j<allAnsReport[n].length;j++) {
if (getGuessFillGapN(n,j)==1) guess++;
}
return guess;
}
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.toString().toLowerCase());
for (i=0; i<value.length; i++) {
str2 = trim(value[i].toString().toLowerCase());
if (str1==str2)
return 1;
}
return 0;
}
function getNumAns(n)
{
return allAnsReport[n].length;
}
function getScore(n)
{
var j,choice,value,data,
score=0,nchoice=0;
for (j=0;j<allAnsReport[n].length;j++) {
choice = allAnsReport[n][j].choice;
value = allAnsReport[n][j].valuation;
data = allAnsReport[n][j].data;
if (choice==1) {
score += value;
nchoice++;
}
else
score += data;
}
if (nchoice==0)
return omitPoint[n];
return score;
}
function getListOfRightAns(n)
{
var j,value,msg='';
for (j=0;j<allAnsReport[n].length;j++) {
value = allAnsReport[n][j].valuation;
if (value>0)
msg += Lettera(j)+' ';
}
return msg;
}
function getNumOfRightAns(n)
{
var j,value,num=0;
for (j=0;j<allAnsReport[n].length;j++) {
value = allAnsReport[n][j].valuation;
if (value>0)
num++;
}
return num;
}
function getListOfSelAns(n)
{
var j,value,msg='';
if (typeOfQuest[n]==3) {    
return allAnsReport[n][0].choice;
}
for (j=0;j<allAnsReport[n].length;j++) {
choice = allAnsReport[n][j].choice;
if ((typeOfQuest[n]==1)||          
(typeOfQuest[n]==101)) {       
if (choice==1)
msg += Lettera(j)+' ';
}
else if (typeOfQuest[n]==2) {    
if (choice==1)
msg += 'V ';
else if (choice==0)
msg += 'F ';
}
else if (typeOfQuest[n]==4) {    
msg += choice+",";
}
else if (typeOfQuest[n]==5) {    
msg += choice[0] + "-" + choice[1] + ", ";
}
}
return msg;
}
function initListOfRemark(n)
{
var j,i,rem,value;
i=0;
this.length=0;
for (j=0;j<allAnsReport[n].length;j++) {
choice = allAnsReport[n][j].choice;
rem = allAnsReport[n][j].remark;
if (choice==1) {
this[i] = rem;
i++;
}
}
this.length = i;
}
function getListOfMistake(n)
{
var j,msg='',separator;
var isFirst=1;
for (j=0;j<allAnsReport[n].length;j++) {
if ((typeOfQuest[n]!=4)&&(typeOfQuest[n]!=5)) {
if (!getGuessAnsN(n,j)) {
if (isFirst==0) {
msg += ' ';
}
else {
isFirst=0;
}
msg += Lettera(j);
}
}
else if (typeOfQuest[n]==4) {
if (!getGuessFillGapN(n,j)) {
if (isFirst==0) {
separator = ', ';
}
else {
separator = '';
isFirst=0;
}
if (allAnsReport[n][j].choice!="") {
msg += separator + allAnsReport[n][j].choice;
}
}
}
else if (typeOfQuest[n]==5) {
if (!getGuessMatchN(n,j)) {
if (isFirst==0) {
msg += ', ';
}
else {
isFirst=0;
}
msg += allAnsReport[n][j].choice[0] + ' - ' + allAnsReport[n][j].choice[1];
}
}
}
return msg;
}
function ComputeMarks()
{
var voto = 0;
var sommaPesi = 0;
var sommatoria = 0;
var votoReal = 0.0;
var puntiGruppo = 0;
var votoGruppo;
var iCapoGruppo;  
for (var i=0;i<questions;i++) {
if ((valid[i]!=2)&&
(valid[i]!=4)&&
((groups[i]==0) || (groups[i]==2)))
sommaPesi += pesi[i];
if (valid[i]==1)
sommatoria += pesi[i];
else if (valid[i]==3)
sommatoria += (pesi[i] * nScore[i]) / maxScore[i];
else if (valid[i]==5) {
if (groups[i]==0)
sommatoria += pesi[i] * (maxScore[i]-minvoto)/(maxvoto-minvoto);
else if (groups[i]==2) {
puntiGruppo = nScore[i];
iCapoGruppo = i;
i++;
while (groups[i]==1) {
puntiGruppo += nScore[i];
i++;
}
votoGruppo = ConvertPointToMark(iCapoGruppo,puntiGruppo);
maxScore[iCapoGruppo] = votoGruppo;
sommatoria += pesi[iCapoGruppo] * (votoGruppo-minvoto)/(maxvoto-minvoto);
}
}
}
if (sommaPesi!=0) {
if (roundvoto==1)
voto = minvoto + Math.round(sommatoria*(maxvoto-minvoto)/sommaPesi);
else if (roundvoto==0) {
voto = minvoto + sommatoria*(maxvoto-minvoto)/sommaPesi;
}
else {
votoReal = sommatoria*(maxvoto-minvoto)/sommaPesi;
voto = minvoto + Math.round(votoReal / roundvoto) * roundvoto;
}
}
else {
window.alert("Warning: unable to compute final mark");
computeMarkErr = 1;
voto = 0;
}
return voto;
}
function CountAnswers() {
var ratio;
var nexcl=0;
nc = 0;
ns = 0;
nr = questions;
for (var i=0;i<questions;i++) {
if (valid[i]==1) nc++;
else if (valid[i]==-1) ns++;
else if (valid[i]==3) {
ratio = 100 * nScore[i] / maxScore[i];
if (ratio>=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;
}
function StoreAnswer(n)
{
var j;
var cookieName = "";
var numOfReport;
for (j=0;j<allAnsReport[n].length;j++) {
cookieName = "qmake.aar"+n+".item"+j;
		
	setTempCookie(cookieName+".choice",""+allAnsReport[n][j].choice);
	setTempCookie(cookieName+".valuation",""+allAnsReport[n][j].valuation);
	setTempCookie(cookieName+".remark",""+allAnsReport[n][j].remark);
	setTempCookie(cookieName+".data",""+allAnsReport[n][j].data);
	setTempCookie(cookieName+".answer",""+allAnsReport[n][j].answer);
}
setTempCookie("qmake.valid"+n,""+valid[n]);
setTempCookie("qmake.nScore"+n,""+nScore[n]);
setTempCookie("qmake.maxScore"+n,""+maxScore[n]); 
setTempCookie("qmake.typeOfQuest"+n,""+typeOfQuest[n]);
setTempCookie("qmake.pesi"+n,""+pesi[n]);
setTempCookie("qmake.end_test",""+end_test);
setTempCookie("qmake.aar"+n+".length",""+allAnsReport[n].length);
numOfReport = getCookie("qmake.aar.length");
if (n+1 > numOfReport) {
setTempCookie("qmake.aar.length",n+1);
}
}
function RetrieveAnswer(n,numOfItems)
{
var j;
var choice,valuation,remark,data,answer;
var cookieName;
this.length = numOfItems;
for (j=0; j<numOfItems; j++) {
cookieName = "qmake.aar"+n+".item"+j;
choice = parseInt(getCookie(cookieName+".choice"));
valuation = parseInt(getCookie(cookieName+".valuation"));
remark = getCookie(cookieName+".remark");
data = getCookie(cookieName+".data");
answer = getCookie(cookieName+".answer");
	
	this[j] = new AnsReport(choice,valuation,remark,data,answer);
}
}
function RetrieveAllAnswer()
{
var i;
var numOfReport;
var numOfItems;
var cookieName;
end_test = parseInt(getCookie("qmake.end_test"));
numOfReport = parseInt(getCookie("qmake.aar.length"));
oldtime = parseInt(getCookie("qmake.startTime"));
for (i=0;i<numOfReport;i++) {
cookieName = "qmake.aar"+i;
	numOfItems = parseInt(getCookie(cookieName+".length"));
	allAnsReport[i] = new RetrieveAnswer(i,numOfItems);
valid[i] = parseInt(getCookie("qmake.valid"+i));
nScore[i] = parseInt(getCookie("qmake.nScore"+i));
maxScore[i] = parseInt(getCookie("qmake.maxScore"+i));
pesi[i] = parseInt(getCookie("qmake.pesi"+i));
typeOfQuest[i] = parseInt(getCookie("qmake.typeOfQuest"+i));
}
}
function ResetAllAnswer()
{
var i;
var numOfReport;
numOfReport = parseInt(getCookie("qmake.aar.length"));
for (i=0;i<numOfReport;i++) {
setTempCookie("qmake.valid"+i,"0");
setTempCookie("qmake.nScore"+i,"0");
setTempCookie("qmake.maxScore"+i,"0");
setTempCookie("qmake.typeOfQuest"+i,"0");
setTempCookie("qmake.pesi"+i,"0");
setTempCookie("qmake.aar"+i+".length","0");
}
setTempCookie("qmake.end_test","0");
setTempCookie("qmake.aar.length","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 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)&&(showTimeout==1)) {
SetClock(getTimeString(delta));
}
if ((delta<=0)&&(end_test==0)) {
window.status = "";
window.alert("The time is over!");
end_test=1;
EndQuiz();
}
else {
ctmnow=setTimeout("Timer()",1000);
}
}
function RestartTimer()
{
if (ctmnow) {
clearTimeout(ctmnow);
ctmnow=0;
}
ctmnow=setTimeout("Timer()",1000);
}
function determinaOrdineIniziale(nvett) {
var i,count,n;
var nuovoPezzo;
this.length=nvett;
for (i=0; i<nvett; i++)
this[i]=-1;
count=0;
while (count<nvett) {
n = rand(nvett);
nuovoPezzo = 1;
for (i=0; i<count; i++) {
if (this[i]==n)
nuovoPezzo = 0;
}
if (nuovoPezzo==1) {
this[count]=n;
count++;
}
}
}
function creaMatching(doc,lista1,lista2,ordine1, ordine2 , nomeSelect, lockLeftCol)
{
var i,n;
var lettera;
for (n=0; n<lista1.length; n++) {
lettera = Lettera(n);
doc.writeln("<TD WIDTH="+pageWidth+"% NOWRAP>");
if (lockLeftCol==0)
doc.writeln("<SELECT NAME='"+nomeSelect+"'>");
else
doc.writeln("<SELECT DISABLED NAME='"+nomeSelect+"'>");
for (i=0; i<lista1.length; i++) {
if (n==i)
doc.writeln("<OPTION SELECTED>"+lista1[ordine1[i]]);
else
doc.writeln("<OPTION>"+lista1[ordine1[i]]);
}
doc.writeln("</SELECT>");
doc.writeln("<SELECT NAME='"+nomeSelect+"'>");
for (i=0; i<lista2.length; i++) {
if (n==i)
doc.writeln("<OPTION SELECTED>"+lista2[ordine2[i]]);
else
doc.writeln("<OPTION>"+lista2[ordine2[i]]);
}
doc.writeln("</SELECT>");
doc.writeln("</TD>");
doc.writeln("<TR>");
}
}
function getSelezione(obj) {
var i;
for (i=0; i<obj.options.length; i++) {
if (obj.options[i].selected)
return i;
}
return -1;
}
function getTextSelected(selObj)
{
var i,found;
found =0;
for (i=0; i<selObj.length;i++) {
if (selObj.options[i].selected) {
found = 1;
break;
}
}
if (found==1) {
return selObj.options[i].value;
}
return "";
}
function AskMeName()
{
userName = window.prompt("Insert your name :","");
if ((userName=="")||(userName==null)) {
userName = "unknown";
}
identityName = userName;
userName = "Candidate name="+userName;
}
function AskMeKeyword(word,digest)
{
if (word=='') {
keyword = window.prompt("Insert the keyword:","");
if (keyword==null) {
PrintWrongKeyword();
return false;
}
else if (digest!=hex_md5(keyword)) {
PrintWrongKeyword();
return false;
}
}
else {
keyword = word;
}
setTempCookie("qmake.pwd",keyword);
MakeKeyCode();
return true;
}
function DoneBefore()
{
window.alert("Hey! You have already answered the question");
}
function IncompletedQuest()
{
window.alert("The answer is incompleted. Please, choose all the items");
}
function Retire()
{
if (window.confirm("Are you sure?")) {
end_test=1;
if (questSlide==1) setTempCookie("qmake.end_test",""+end_test);
EndQuiz();
}
}
function PrintStatusBar()
{
var i;
var msg;
if (nr==questions)
return;
if (silent==1) {
window.status="to be answered: "+nr+" questions.";
return;
}
msg="on "+(questions-nr)+" questions, ";
if (nc>1) 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 checkRisposta(checkBox,risp,n)
{
if ( ((checkBox.checked==true) && (isRightAns(n,risp)==1)) ||
((checkBox.checked==false) && (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 isRightAns(nAns,risp)
{
var i;
for (i=0; i<risp.length; i++)
if (risp[i]==nAns)
return 1;
return 0;
}
function VerifyReload(time,titolo,indice)
{
var valore = getCookie("Qmake"+qmakeVers+"-"+indice);
if (valore==titolo) {
end_test=1;
PrintNoReload();
return 0;
}
setCookie("Qmake"+qmakeVers+"-"+indice,titolo,time);
return 1;
}
function verifyAnswer (risp,nrisp,ri)
{
var i;
for (i=0;i<nrisp;i++) {
if (risp[i]==ri)
return 1;
}
return 0;
}
function GetCopyrightMsg()
{
var msg;
msg = "<CENTER>";
msg += "<FONT SIZE=1 FACE='Arial, Helvetica' COLOR='#666666'>";
msg += "This quiz was created ";
if (author!='') {
msg += "by <B>"+author+"</B> ";
}
msg += "with <A HREF='http://"+qmakeURL+"' TARGET='qf_website'><FONT SIZE=1 FACE='Arial, Helvetica' COLOR='#666666'>"+qmakeProgName+" "+qmakeVers+"</FONT></A>";
msg += "</FONT></CENTER>";
return msg;
}
var tagOkImage;
var tagBoxImage;
var tagArrowImage;
var tagResponseImageOk;
var tagResponseImageKo;
function PrintReportStyle(doc, report_style)
{
doc.writeln("<style>\n");
doc.writeln("TD,B,BODY {font-family:Arial; font-size:10pt  }\n");
doc.writeln(".table1 {font-family:Arial; font-size:10pt; font-weight:bold  } \n");
if (report_style == 0) {
doc.writeln(".report_qstId {font-family:courier; font-size:16pt; font-weight:bold; background:#404040; color:#FFFFFF }\n");
doc.writeln(".report_qstText {font-family:Arial; font-size:10pt; font-weight:bold }\n");
doc.writeln(".report_qstEvalText {font-family:Arial; font-size:10pt; font-style:italic }\n");
doc.writeln(".report_letterText {font-family:Arial; font-size:10pt }\n");
doc.writeln(".report_ansText {font-family:Arial; font-size:10pt }\n");
}
else {
doc.writeln(".report_qstId {font-family:'Arial narrow'; font-size:10pt; font-weight:bold; background:#404040; color:#FFFFFF }\n");
doc.writeln(".report_qstText {font-family:'Arial narrow'; font-size:8pt; font-weight:bold }\n");
doc.writeln(".report_qstEvalText {font-family:'Arial narrow'; font-size:8pt; font-style:italic }\n");
doc.writeln(".report_letterText {font-family:Arial; font-size:8pt }\n");
doc.writeln(".report_ansText {font-family:Arial; font-size:8pt }\n");
}
doc.writeln("</style>\n");
}
function PrintQstReport(qst_index, qst_num, doc, report_style)
{
doc.writeln("<FONT class='report_qstId'>"+qst_index+"</FONT> ");
doc.writeln("<FONT class='report_qstText'>"+qstHead[qst_num]+"</FONT>");
doc.writeln("<BR>");
doc.writeln("<FONT class='report_qstEvalText'>");
if (valid[qst_num]==1) {
doc.writeln("Correct answer");
}
else if (valid[qst_num]==-1) {
doc.writeln("Wrong answer");
}
else if (valid[qst_num]==2) {
doc.writeln("Question not valuated");
}
else if (valid[qst_num]==3) {
if (typeOfQuest[qst_num]==2) {
doc.writeln("Right sentences "+nScore[qst_num]+" on "+maxScore[qst_num]);
}
else if (typeOfQuest[qst_num]==4) {
doc.writeln("Guess words "+nScore[qst_num]+" on "+maxScore[qst_num]);
}
else if (typeOfQuest[qst_num]==5) {
doc.writeln("Matching "+nScore[qst_num]+" on "+maxScore[qst_num]);
}
}
else if (valid[qst_num]==5) {
doc.write("scores "+nScore[qst_num]);
if (groups[qst_num]==0) {
doc.writeln(" (MARK "+maxScore[qst_num]+")");
}
else if (groups[qst_num]==1) {
doc.writeln("<BR>Scores added with the previous question  ");
}
else if (groups[qst_num]==2) {
doc.writeln("<BR>MARK (computes from the sum of scores of next questions): "+maxScore[qst_num]);
}
}
doc.writeln("</FONT>");
doc.writeln("<BR>");
}
function PrintAnsReport(qst_num, ans_num, doc, report_style)
{
var isGuess;
var choice,value,data;
var l,m;
if (typeOfQuest[qst_num]==4)
isGuess = getGuessFillGapN(qst_num,ans_num);
else if (typeOfQuest[qst_num]==5)
isGuess = (getGuessMatchN(qst_num,ans_num)==1);
else if (typeOfQuest[qst_num]==2)
isGuess = getGuessAnsN(qst_num,ans_num); 
else {
if (reportNotation==1) 
isGuess = getGuessAnsN(qst_num,ans_num);
else 
isGuess = (allAnsReport[qst_num][ans_num].valuation + allAnsReport[qst_num][ans_num].data)>0;
}
if (report_style == 0) {
if (isGuess) {
doc.write("<TD WIDTH=30>"+tagResponseImageOk+"</TD>");
}
else {
doc.write("<TD WIDTH=30>"+tagResponseImageKo+"</TD>");
}
}
if (report_style == 0) {
doc.write("<TD WIDTH=30>");
doc.write("<FONT class='report_letterText'>"+Lettera(ans_num)+"</FONT>");
doc.write("</TD>");
}
else {
doc.write("<TD WIDTH=10>");
doc.write("<FONT class='report_letterText'>");
if (isGuess)
doc.write("<U>"+Lettera(ans_num)+"</U>");
else
doc.write(Lettera(ans_num));
doc.write("</FONT>");
doc.write("</TD>");
}
choice = allAnsReport[qst_num][ans_num].choice;
if (typeOfQuest[qst_num]==2) {
doc.write("<TD WIDTH=50> ");
PrintTrueOrFalse(doc,1);
doc.write(" ");
if (choice==1)
doc.write(tagOkImage+"</TD>");
else
doc.write(tagBoxImage+"</TD>");
doc.write("<TD WIDTH=50> ");
PrintTrueOrFalse(doc,0);
doc.write(" ");
if (choice==0)
doc.write(tagOkImage+"</TD>");
else
doc.write(tagBoxImage+"</TD>");
}
else if (typeOfQuest[qst_num]==4) {
doc.write("<TD><FONT class='report_ansText'>");
if (getGuessFillGapN(qst_num,ans_num))
doc.write(choice);
else {
doc.write("<S>"+choice+"</S>");
if (report_style == 0)
doc.write(" "+tagArrowImage+" ");
else
doc.write(" -> ");
for (l=0; l<allAnsReport[qst_num][ans_num].valuation.length-1; l++)
doc.write(allAnsReport[qst_num][ans_num].valuation[l]+ " , ");
doc.write(allAnsReport[qst_num][ans_num].valuation[l]);
}
doc.write("</FONT></TD>");
}
else if (typeOfQuest[qst_num]==5) {
doc.write("<TD><FONT class='report_ansText'>");
m = getGuessMatchN(qst_num,ans_num);
if (m==1) {
doc.write(choice[0]+" - "+choice[1]);
}
else if (m==0) {
doc.write(choice[0]+" - ");
doc.write("<S>"+choice[1]+"</S>");
if (report_style == 0)
doc.write(" "+tagArrowImage+" ");
else
doc.write(" -> ");
for (l=0; l<allAnsReport[qst_num][ans_num].valuation.length-1; l++)
doc.write(allAnsReport[qst_num][ans_num].valuation[l]+ " , ");
doc.write(allAnsReport[qst_num][ans_num].valuation[l]);
}
else {
doc.write("<S>"+choice[0]+" - "+choice[1]+"</S>");
}
doc.write("</FONT></TD>");
}
else {
if (report_style == 0)
doc.write("<TD WIDTH=30>");
else
doc.write("<TD WIDTH=22>");
if (choice==1)
doc.write(tagOkImage);
else
doc.write(tagBoxImage);
doc.write("</TD>");
}
doc.writeln("<TD>");
if (valid[qst_num]==5) {
value = allAnsReport[qst_num][ans_num].valuation;
data = allAnsReport[qst_num][ans_num].data;
doc.write(" ("+value+") ");
if (data!=0)
doc.write(" ("+data+") ");
}
if ((typeOfQuest[qst_num]==1)||(typeOfQuest[qst_num]==101)) {
if (allAnsReport[qst_num][ans_num].answer!="")
doc.write(allAnsReport[qst_num][ans_num].answer+"<BR>");
if ((choice==1)||(remRepAlways==1))
doc.write("<I>"+allAnsReport[qst_num][ans_num].remark+"</I>");
}
doc.writeln("</TD>");
}
function PrintReport(doc,report_style)
{
var i,j,n=1,k;
var half_index,index13,index23,index14,index34,col_width;
var okImage,boxImage,arrowImage,responseImageOk,responseImageKo;
if (isResultsPageDark==0) {
okImage  = mediaDir+"/ok.gif";
boxImage = mediaDir+"/square.gif";
}
else {
okImage  = mediaDir+"/ok2.gif";
boxImage = mediaDir+"/square2.gif";
}
tagOkImage = "<IMG SRC="+unescape("%22")+okImage+unescape("%22")+" ALIGN='CENTER' ALT='Selected answer'>";
tagBoxImage = "<IMG SRC="+unescape("%22")+boxImage+unescape("%22")+" ALIGN='CENTER'>";
arrowImage = mediaDir+"/arrow.gif";
tagArrowImage = "<IMG SRC="+unescape("%22")+arrowImage+unescape("%22")+" ALIGN='CENTER'>";
responseImageOk = mediaDir+"/smile.gif";
tagResponseImageOk = "<IMG SRC="+unescape("%22")+responseImageOk+unescape("%22")+" ALIGN='CENTER' ALT='Correct answer'>";
responseImageKo = mediaDir+"/ko.gif";
tagResponseImageKo = "<IMG SRC="+unescape("%22")+responseImageKo+unescape("%22")+" ALIGN='CENTER' ALT='Wrong answer'>";
half_index = Math.ceil(questions/2);
index13  = Math.ceil(questions/3);
index23  = Math.ceil(2*questions/3);
index14  = Math.ceil(questions/4);
index34  = Math.ceil(3*questions/4);
col_width  = Math.floor(100 / ncols_report);
doc.writeln("<P><center><TABLE WIDTH='"+pageWidth+"%' BORDER=0>");
for (k=0;k<questions;k++) {
if ((k==0)&&(ncols_report==1)) {
doc.writeln("<TD>\n");
}
if ((k==0)&&(ncols_report>=2)) {
doc.writeln("<TD WIDTH='"+col_width+"%' VALIGN='top'>\n");
}
if ((k==half_index)&&((ncols_report==2)||(ncols_report==4))) {
doc.writeln("</TD><TD WIDTH='"+col_width+"%' VALIGN='top'>");
}
if (ncols_report==3) {
if ((k==index13)||(k==index23)) {
doc.writeln("</TD><TD WIDTH='33%' VALIGN='top'>");
}
}
if (ncols_report==4) {
if ((k==index14)||(k==index34)) {
doc.writeln("</TD><TD WIDTH='25%' VALIGN='top'>");
}
}
i = ordineDomande[k];
if (valid[i]==4)
continue;
PrintQstReport(n,i,doc,report_style);
n++;
if (report_style == 0)
doc.writeln("<BR>");
if (valid[i]==2) {
doc.write("<FONT class='report_ansText'>"+allAnsReport[i][0].choice+"</FONT>");
continue;
}
doc.writeln("<TABLE BORDER=0>");
for (j=0;j<allAnsReport[i].length;j++) {
if (report_style == 0)
doc.write("<TR>");
PrintAnsReport(i,j,doc,report_style);
if (report_style == 0)
doc.write("</TR>");
}
doc.writeln("</TABLE><BR>");
}
doc.writeln("</TD></TABLE></center>");
}
function PrintLinkBar(doc)
{
var count = 0;
if (incl_print_btn) {
if (count>0) doc.writeln(" | ");
doc.writeln("<a href='javascript:printWindow()'>PRINT</A>");
count++;
}
if (man_repeat) {
if (count>0) doc.writeln(" | ");
doc.writeln("<a href='javascript:RepeatQuiz()'>REPEAT</A>");
count++;
}
if (topChartFile!='') {
if (count>0) doc.writeln(" | ");
doc.writeln("<a href='"+topChartFile+"' TARGET='topchartwin'>Top Chart</A>");
count++;
}
if (incl_close_btn) {
if (count>0) doc.writeln(" | ");
doc.writeln("<a href='javascript:top.close()'>QUIT</A>");
count++;
}
}
function PrintResultTopBar(doc)
{
if ((showReport==1)&&(dhtmlEnabled==1)) {
doc.writeln("<center><TABLE WIDTH='"+pageWidth+"%' BORDER=0 BGCOLOR='#D0D0D0'>\n");
doc.writeln("<TD ALIGN='LEFT'><B>Quiz Result</B></TD>\n");
doc.writeln("<TD ALIGN='RIGHT'>");
PrintLinkBar(doc);
doc.writeln("</TD></TABLE></center><BR>\n");
}
}
function PrintLinkBack(doc)
{
if (incl_linkback || incl_print_btn || man_repeat || (topChartFile!='') || incl_close_btn) {
doc.writeln("<center><TABLE WIDTH='"+pageWidth+"%' BORDER=0 BGCOLOR='#D0D0D0'>\n");
doc.writeln("<TD ALIGN='LEFT'>");
if (incl_linkback)
PrintATagLinkBack(doc);
doc.writeln("</TD>");
doc.writeln("<TD ALIGN='RIGHT'>\n");
PrintLinkBar(doc);
doc.writeln("</TD></TABLE></center><BR>\n");
}
}
function PrintFrame(doc,titolo,msg)
{
doc.clear();
doc.open();
PrintOpenHTML(doc,titolo,1);
doc.writeln (bodyTagFrame1);
doc.writeln (msg);
doc.writeln ("</body></html>");
doc.close();
}
function PrintJSResult(doc)
{
doc.writeln("<script language='javascript'>\n");
doc.writeln("function printWindow(){\n");
doc.writeln("   window.print();\n");
doc.writeln("}\n");
doc.writeln("function RepeatQuiz(){\n"); 
doc.writeln("  if (window.top!=window.self) { window.top.location='"+filename+".htm'; } else { window.location='"+filename+".htm'; }");
doc.writeln("}\n");
doc.writeln("</script>\n");
}
function GetVoto(mark)
{
var tipo;
var str="";
tipo = GetTypeOfSubstitution(mark);
if (tipo == 2) {
return GetRemFromMark(voto);
}
else {
if (markPercentage==0) {
str += ""+voto+"/"+maxvoto;
}
else {
str += ""+voto+"/"+maxvoto+" ( "+Math.floor(voto*100/maxvoto)+"% )";
}
if (tipo == 1) {
str += " - "+GetRemFromMark(voto);
}
return str;
}
}
function PrintAnswer(n,textField)
{
var msg;
var explan = new initListOfRemark(n);
end_test = CountAnswers();
PrintStatusBar();
if (silent==1) {
if (PrintAnswer.arguments.length>1)
textField.value = "Selected answer";
}
else {
if (valid[n]==1) {
if (PrintAnswer.arguments.length>1)
textField.value = "Correct answer";
msg = "Good ! Right answer";
}
else {
msg = "Wrong! The correct answer was " + getListOfRightAns(n);
if (PrintAnswer.arguments.length>1)
textField.value = msg;
}
if (soundEnable==1)
PlaySound(GetSoundID(n));
ShowMessage(msg,explan);
}
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function PrintOpenAnswer(n,outMsg) {
outMsg.value = "Answer completed";
end_test = CountAnswers();
PrintStatusBar();
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function PrintBooleanAnswer(n,textField)
{
var msg,msg2;
var explan= new initOneElementVector();
explan[0] = "";
end_test = CountAnswers();
PrintStatusBar();
if (silent==0) {
msg = "Right Answers " + nScore[n] + " / " + getNumAns(n);
textField.value = msg;
if (nScore[n]<getNumAns(n)) {
msg2 = "Wrong Answers : " + getListOfMistake(n);
textField.value += " ; " + msg2;
explan[0] = msg2;
}
if (soundEnable==1)
PlaySound(GetSoundID(n));
ShowMessage(msg,explan);
}
else
textField.value = "Selected answer";
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function PrintQuestionScore(n,textField)
{
var msg;
var explan = new initListOfRemark(n);
end_test = CountAnswers();
PrintStatusBar();
if (silent==0) {
msg = "Score : " + nScore[n];
if (groups[n]==0) 
msg += " (MARK "+maxScore[n]+")";
textField.value = msg;
if (getGuessAns(n)<getNumAns(n))
msg += "<BR>The correct answer was " + getListOfRightAns(n);
if (soundEnable==1)
PlaySound(GetSoundID(n));
ShowMessage(msg,explan);
}
else
textField.value = "Selected answer";
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function ShowMessage(message,explan)
{
var i;
var msg=message;
for (i=0;i<explan.length; i++) {
if (explan[i]!="")
msg += "\n"+explan[i];
}
window.alert(msg);
}
function PrintWrongKeyword()
{
document.clear();
document.open();
PrintOpenHTML(document,"",1);
document.writeln (bodyTagFrame1);
document.writeln("<CENTER><FONT SIZE=6 FACE='Arial' COLOR='#FF0000'>Watch out!</FONT><BR>");
document.writeln ("<FONT SIZE=+2>The keyword isn't correct</FONT><BR>");
document.writeln ("Unable to continue the quiz<BR>");
document.writeln ("For information, contact the quiz's author<BR>");
document.writeln("<P><INPUT TYPE='BUTTON' VALUE='QUIT' OnClick='top.close()'>");
document.writeln("</CENTER>");
PrintCopyright();
document.writeln ("</body></html>");
document.close();
}
function PrintNoReload()
{
document.clear();
document.open();
PrintOpenHTML(document,"",1);
document.writeln (bodyTagFrame1);
document.writeln("<CENTER><BR><BR><FONT SIZE=6 FACE='Arial' COLOR='#FF0000'>Watch out!</FONT><BR>");
document.writeln ("<FONT SIZE=+2>Reload of quiz is not allowed</FONT><BR>");
document.writeln ("Unable to start the quiz<BR>");
document.writeln ("For information, contact the quiz's author<BR>");
document.writeln("<P><INPUT TYPE='BUTTON' VALUE='QUIT' OnClick='top.close()'>");
document.writeln("</CENTER>");
PrintCopyright();
document.writeln ("</body></html>");
document.close();
}
function AskPrintQuiz() {
if (window.confirm("Print quiz ?")) {
window.print();
window.alert("QUIT PRINT");
}
}
function PrintCopyright()
{
if (printCpRg==1) {
document.writeln(GetCopyrightMsg());
}
}
function PrintResults()
{
if (GetTypeOfSubstitution(voto)==4) {
document.location = GetLinkFromMark(voto);
window.status = "";
return;
}
document.close();
document.clear();
document.open();
PrintOpenHTML(document,"Quiz Result",0);
PrintReportStyle(document,compressReport);
PrintJSResult(document);
document.writeln("</head>");
document.writeln(bodyTagFrame1);
if (valutaQuiz==1) {
if (GetTypeOfSubstitution(voto)<=2) {
PrintResultTopBar(document);
PrintResultsTable(document);
if (showReport==1)
PrintReport(document,compressReport);
}
else if (GetTypeOfSubstitution(voto)==3) {
document.writeln("<center><TABLE WIDTH='"+pageWidth+"%' BORDER=0><TD ALIGN='LEFT'>");
document.writeln (GetRemFromMark(voto));
document.writeln("</TD></TABLE></center>");
}
else {
}
}
else {
document.writeln("<center><TABLE WIDTH='"+pageWidth+"%' BORDER=0><TD ALIGN='LEFT'>");
document.writeln(finalMess);
document.writeln("</TD></TABLE></center>");
}
PrintLinkBack(document);
PrintCopyright();
document.writeln ("</body></html>");
document.close();
window.status = "";
}
function SetClock(timeStr)
{
window.status = timeStr;
}
function GetSoundName(n)
{
if ((valid[n]==-1)||(maxScore[n]==minvoto))
return document.errSound;
if ((valid[n]==1)||(maxScore[n]==maxvoto))
return document.okSound;
if ((valid[n]==3)||(valid[n]==5))
return document.warnSound;
return document.warnSound;
}
function GetSoundID(n)
{
if ((valid[n]==-1)||(maxScore[n]==minvoto))
return 'errSoundID';
if ((valid[n]==1)||(maxScore[n]==maxvoto))
return 'okSoundID';
if ((valid[n]==3)||(valid[n]==5))
return 'warnSoundID';
return 'warnSoundID';
}
function showTooltip (strTooltip) {
showTimeout = 0;
window.status = "Hint: "+strTooltip;
}
function clearTooltip () {
setTimeout(deleteTooltip,1000);
}
function deleteTooltip () {
window.status = "";
showTimeout = 1;
}
function completeInitValuate() {
 if (valid[0]==0) {
   allAnsReport[0] = new initValuate1();
   doValuate(0,document.domanda.score1,document.domanda.risposta1);
 }
 if (valid[1]==0) {
   allAnsReport[1] = new initValuate2();
   doValuate(1,document.domanda.score2,document.domanda.risposta2);
 }
 if (valid[2]==0) {
   allAnsReport[2] = new initValuate3();
   doValuate(2,document.domanda.score3,document.domanda.risposta3);
 }
 if (valid[3]==0) {
   allAnsReport[3] = new initValuate4();
   doValuate(3,document.domanda.score4,document.domanda.risposta4);
 }
 if (valid[4]==0) {
   allAnsReport[4] = new initValuate5();
   doValuate(4,document.domanda.score5,document.domanda.risposta5);
 }
 if (valid[5]==0) {
   allAnsReport[5] = new initValuate6();
   doValuate(5,document.domanda.score6,document.domanda.risposta6);
 }
 if (valid[6]==0) {
   allAnsReport[6] = new initValuate7();
   doValuate(6,document.domanda.score7,document.domanda.risposta7);
 }
 if (valid[7]==0) {
   allAnsReport[7] = new initValuate8();
   doValuate(7,document.domanda.score8,document.domanda.risposta8);
 }
 if (valid[8]==0) {
   allAnsReport[8] = new initValuate9();
   doValuate(8,document.domanda.score9,document.domanda.risposta9);
 }
 if (valid[9]==0) {
   allAnsReport[9] = new initValuate10();
   doValuate(9,document.domanda.score10,document.domanda.risposta10);
 }
 if (valid[10]==0) {
   allAnsReport[10] = new initValuate11();
   doValuate(10,document.domanda.score11,document.domanda.risposta11);
 }
 if (valid[11]==0) {
   allAnsReport[11] = new initValuate12();
   doValuate(11,document.domanda.score12,document.domanda.risposta12);
 }
 if (valid[12]==0) {
   allAnsReport[12] = new initValuate13();
   doValuate(12,document.domanda.score13,document.domanda.risposta13);
 }
 if (valid[13]==0) {
   allAnsReport[13] = new initValuate14();
   doValuate(13,document.domanda.score14,document.domanda.risposta14);
 }
 if (valid[14]==0) {
   allAnsReport[14] = new initValuate15();
   doValuate(14,document.domanda.score15,document.domanda.risposta15);
 }
 if (valid[15]==0) {
   allAnsReport[15] = new initValuate16();
   doValuate(15,document.domanda.score16,document.domanda.risposta16);
 }
 if (valid[16]==0) {
   allAnsReport[16] = new initValuate17();
   doValuate(16,document.domanda.score17,document.domanda.risposta17);
 }
 if (valid[17]==0) {
   allAnsReport[17] = new initValuate18();
   doValuate(17,document.domanda.score18,document.domanda.risposta18);
 }
 if (valid[18]==0) {
   allAnsReport[18] = new initValuate19();
   doValuate(18,document.domanda.score19,document.domanda.risposta19);
 }
 if (valid[19]==0) {
   allAnsReport[19] = new initValuate20();
   doValuate(19,document.domanda.score20,document.domanda.risposta20);
 }
 if (valid[20]==0) {
   allAnsReport[20] = new initValuate21();
   doValuate(20,document.domanda.score21,document.domanda.risposta21);
 }
 if (valid[21]==0) {
   allAnsReport[21] = new initValuate22();
   doValuate(21,document.domanda.score22,document.domanda.risposta22);
 }
 if (valid[22]==0) {
   allAnsReport[22] = new initValuate23();
   doValuate(22,document.domanda.score23,document.domanda.risposta23);
 }
 if (valid[23]==0) {
   allAnsReport[23] = new initValuate24();
   doValuate(23,document.domanda.score24,document.domanda.risposta24);
 }
 if (valid[24]==0) {
   allAnsReport[24] = new initValuate25();
   doValuate(24,document.domanda.score25,document.domanda.risposta25);
 }
 if (valid[25]==0) {
   allAnsReport[25] = new initValuate26();
   doValuate(25,document.domanda.score26,document.domanda.risposta26);
 }
 if (valid[26]==0) {
   allAnsReport[26] = new initValuate27();
   doValuate(26,document.domanda.score27,document.domanda.risposta27);
 }
 if (valid[27]==0) {
   allAnsReport[27] = new initValuate28();
   doValuate(27,document.domanda.score28,document.domanda.risposta28);
 }
 if (valid[28]==0) {
   allAnsReport[28] = new initValuate29();
   doValuate(28,document.domanda.score29,document.domanda.risposta29);
 }
 if (valid[29]==0) {
   allAnsReport[29] = new initValuate30();
   doValuate(29,document.domanda.score30,document.domanda.risposta30);
 }
 if (valid[30]==0) {
   allAnsReport[30] = new initValuate31();
   doValuate(30,document.domanda.score31,document.domanda.risposta31);
 }
 if (valid[31]==0) {
   allAnsReport[31] = new initValuate32();
   doValuate(31,document.domanda.score32,document.domanda.risposta32);
 }
 if (valid[32]==0) {
   allAnsReport[32] = new initValuate33();
   doValuate(32,document.domanda.score33,document.domanda.risposta33);
 }
 if (valid[33]==0) {
   allAnsReport[33] = new initValuate34();
   doValuate(33,document.domanda.score34,document.domanda.risposta34);
 }
 if (valid[34]==0) {
   allAnsReport[34] = new initValuate35();
   doValuate(34,document.domanda.score35,document.domanda.risposta35);
 }
 if (valid[35]==0) {
   allAnsReport[35] = new initValuate36();
   doValuate(35,document.domanda.score36,document.domanda.risposta36);
 }
 if (valid[36]==0) {
   allAnsReport[36] = new initValuate37();
   doValuate(36,document.domanda.score37,document.domanda.risposta37);
 }
 if (valid[37]==0) {
   allAnsReport[37] = new initValuate38();
   doValuate(37,document.domanda.score38,document.domanda.risposta38);
 }
 if (valid[38]==0) {
   allAnsReport[38] = new initValuate39();
   doValuate(38,document.domanda.score39,document.domanda.risposta39);
 }
 if (valid[39]==0) {
   allAnsReport[39] = new initValuate40();
   doValuate(39,document.domanda.score40,document.domanda.risposta40);
 }
 if (valid[40]==0) {
   allAnsReport[40] = new initValuate41();
   doValuate(40,document.domanda.score41,document.domanda.risposta41);
 }
 if (valid[41]==0) {
   allAnsReport[41] = new initValuate42();
   doValuate(41,document.domanda.score42,document.domanda.risposta42);
 }
 if (valid[42]==0) {
   allAnsReport[42] = new initValuate43();
   doValuate(42,document.domanda.score43,document.domanda.risposta43);
 }
 if (valid[43]==0) {
   allAnsReport[43] = new initValuate44();
   doValuate(43,document.domanda.score44,document.domanda.risposta44);
 }
 if (valid[44]==0) {
   allAnsReport[44] = new initValuate45();
   doValuate(44,document.domanda.score45,document.domanda.risposta45);
 }
 if (valid[45]==0) {
   allAnsReport[45] = new initValuate46();
   doValuate(45,document.domanda.score46,document.domanda.risposta46);
 }
 if (valid[46]==0) {
   allAnsReport[46] = new initValuate47();
   doValuate(46,document.domanda.score47,document.domanda.risposta47);
 }
 if (valid[47]==0) {
   allAnsReport[47] = new initValuate48();
   doValuate(47,document.domanda.score48,document.domanda.risposta48);
 }
 if (valid[48]==0) {
   allAnsReport[48] = new initValuate49();
   doValuate(48,document.domanda.score49,document.domanda.risposta49);
 }
 if (valid[49]==0) {
   allAnsReport[49] = new initValuate50();
   doValuate(49,document.domanda.score50,document.domanda.risposta50);
 }
 if (valid[50]==0) {
   allAnsReport[50] = new initValuate51();
   doValuate(50,document.domanda.score51,document.domanda.risposta51);
 }
 if (valid[51]==0) {
   allAnsReport[51] = new initValuate52();
   doValuate(51,document.domanda.score52,document.domanda.risposta52);
 }
 if (valid[52]==0) {
   allAnsReport[52] = new initValuate53();
   doValuate(52,document.domanda.score53,document.domanda.risposta53);
 }
 if (valid[53]==0) {
   allAnsReport[53] = new initValuate54();
   doValuate(53,document.domanda.score54,document.domanda.risposta54);
 }
 if (valid[54]==0) {
   allAnsReport[54] = new initValuate55();
   doValuate(54,document.domanda.score55,document.domanda.risposta55);
 }
 if (valid[55]==0) {
   allAnsReport[55] = new initValuate56();
   doValuate(55,document.domanda.score56,document.domanda.risposta56);
 }
 if (valid[56]==0) {
   allAnsReport[56] = new initValuate57();
   doValuate(56,document.domanda.score57,document.domanda.risposta57);
 }
 if (valid[57]==0) {
   allAnsReport[57] = new initValuate58();
   doValuate(57,document.domanda.score58,document.domanda.risposta58);
 }
 if (valid[58]==0) {
   allAnsReport[58] = new initValuate59();
   doValuate(58,document.domanda.score59,document.domanda.risposta59);
 }
 if (valid[59]==0) {
   allAnsReport[59] = new initValuate60();
   doValuate(59,document.domanda.score60,document.domanda.risposta60);
 }
 if (valid[60]==0) {
   allAnsReport[60] = new initValuate61();
   doValuate(60,document.domanda.score61,document.domanda.risposta61);
 }
 if (valid[61]==0) {
   allAnsReport[61] = new initValuate62();
   doValuate(61,document.domanda.score62,document.domanda.risposta62);
 }
 if (valid[62]==0) {
   allAnsReport[62] = new initValuate63();
   doValuate(62,document.domanda.score63,document.domanda.risposta63);
 }
 if (valid[63]==0) {
   allAnsReport[63] = new initValuate64();
   doValuate(63,document.domanda.score64,document.domanda.risposta64);
 }
 if (valid[64]==0) {
   allAnsReport[64] = new initValuate65();
   doValuate(64,document.domanda.score65,document.domanda.risposta65);
 }
 if (valid[65]==0) {
   allAnsReport[65] = new initValuate66();
   doValuate(65,document.domanda.score66,document.domanda.risposta66);
 }
 if (valid[66]==0) {
   allAnsReport[66] = new initValuate67();
   doValuate(66,document.domanda.score67,document.domanda.risposta67);
 }
 if (valid[67]==0) {
   allAnsReport[67] = new initValuate68();
   doValuate(67,document.domanda.score68,document.domanda.risposta68);
 }
 if (valid[68]==0) {
   allAnsReport[68] = new initValuate69();
   doValuate(68,document.domanda.score69,document.domanda.risposta69);
 }
 if (valid[69]==0) {
   allAnsReport[69] = new initValuate70();
   doValuate(69,document.domanda.score70,document.domanda.risposta70);
 }
 if (valid[70]==0) {
   allAnsReport[70] = new initValuate71();
   doValuate(70,document.domanda.score71,document.domanda.risposta71);
 }
 if (valid[71]==0) {
   allAnsReport[71] = new initValuate72();
   doValuate(71,document.domanda.score72,document.domanda.risposta72);
 }
 if (valid[72]==0) {
   allAnsReport[72] = new initValuate73();
   doValuate(72,document.domanda.score73,document.domanda.risposta73);
 }
 if (valid[73]==0) {
   allAnsReport[73] = new initValuate74();
   doValuate(73,document.domanda.score74,document.domanda.risposta74);
 }
 if (valid[74]==0) {
   allAnsReport[74] = new initValuate75();
   doValuate(74,document.domanda.score75,document.domanda.risposta75);
 }
 if (valid[75]==0) {
   allAnsReport[75] = new initValuate76();
   doValuate(75,document.domanda.score76,document.domanda.risposta76);
 }
 if (valid[76]==0) {
   allAnsReport[76] = new initValuate77();
   doValuate(76,document.domanda.score77,document.domanda.risposta77);
 }
 if (valid[77]==0) {
   allAnsReport[77] = new initValuate78();
   doValuate(77,document.domanda.score78,document.domanda.risposta78);
 }
 if (valid[78]==0) {
   allAnsReport[78] = new initValuate79();
   doValuate(78,document.domanda.score79,document.domanda.risposta79);
 }
 if (valid[79]==0) {
   allAnsReport[79] = new initValuate80();
   doValuate(79,document.domanda.score80,document.domanda.risposta80);
 }
 if (valid[80]==0) {
   allAnsReport[80] = new initValuate81();
   doValuate(80,document.domanda.score81,document.domanda.risposta81);
 }
 if (valid[81]==0) {
   allAnsReport[81] = new initValuate82();
   doValuate(81,document.domanda.score82,document.domanda.risposta82);
 }
 if (valid[82]==0) {
   allAnsReport[82] = new initValuate83();
   doValuate(82,document.domanda.score83,document.domanda.risposta83);
 }
 if (valid[83]==0) {
   allAnsReport[83] = new initValuate84();
   doValuate(83,document.domanda.score84,document.domanda.risposta84);
 }
 if (valid[84]==0) {
   allAnsReport[84] = new initValuate85();
   doValuate(84,document.domanda.score85,document.domanda.risposta85);
 }
 if (valid[85]==0) {
   allAnsReport[85] = new initValuate86();
   doValuate(85,document.domanda.score86,document.domanda.risposta86);
 }
 if (valid[86]==0) {
   allAnsReport[86] = new initValuate87();
   doValuate(86,document.domanda.score87,document.domanda.risposta87);
 }
 if (valid[87]==0) {
   allAnsReport[87] = new initValuate88();
   doValuate(87,document.domanda.score88,document.domanda.risposta88);
 }
 if (valid[88]==0) {
   allAnsReport[88] = new initValuate89();
   doValuate(88,document.domanda.score89,document.domanda.risposta89);
 }
 if (valid[89]==0) {
   allAnsReport[89] = new initValuate90();
   doValuate(89,document.domanda.score90,document.domanda.risposta90);
 }
 if (valid[90]==0) {
   allAnsReport[90] = new initValuate91();
   doValuate(90,document.domanda.score91,document.domanda.risposta91);
 }
 if (valid[91]==0) {
   allAnsReport[91] = new initValuate92();
   doValuate(91,document.domanda.score92,document.domanda.risposta92);
 }
 if (valid[92]==0) {
   allAnsReport[92] = new initValuate93();
   doValuate(92,document.domanda.score93,document.domanda.risposta93);
 }
 if (valid[93]==0) {
   allAnsReport[93] = new initValuate94();
   doValuate(93,document.domanda.score94,document.domanda.risposta94);
 }
 if (valid[94]==0) {
   allAnsReport[94] = new initValuate95();
   doValuate(94,document.domanda.score95,document.domanda.risposta95);
 }
 if (valid[95]==0) {
   allAnsReport[95] = new initValuate96();
   doValuate(95,document.domanda.score96,document.domanda.risposta96);
 }
 if (valid[96]==0) {
   allAnsReport[96] = new initValuate97();
   doValuate(96,document.domanda.score97,document.domanda.risposta97);
 }
 if (valid[97]==0) {
   allAnsReport[97] = new initValuate98();
   doValuate(97,document.domanda.score98,document.domanda.risposta98);
 }
 if (valid[98]==0) {
   allAnsReport[98] = new initValuate99();
   doValuate(98,document.domanda.score99,document.domanda.risposta99);
 }
 if (valid[99]==0) {
   allAnsReport[99] = new initValuate100();
   doValuate(99,document.domanda.score100,document.domanda.risposta100);
 }
 CountAnswers();
}

function ConvertPointToMark(n,points) {
return 0;
}


function PrintResultsTable(doc) {
  var deltatime = time - oldtime;
  var percentage;
  doc.writeln("<center><TABLE border=0 WIDTH='80%'><TD ALIGN='LEFT'><TABLE border=0 cellpadding=1>");
  doc.writeln("<TR><TD bgcolor='#000000'>");
  doc.writeln("<TABLE cellpadding=3 border=0 cellspacing=1><TR><TD bgcolor='#FFFFFF' colspan=2>");
  doc.writeln("<TABLE cellpadding=5 border=0 width=100%><TR><TD>");
  doc.writeln("<B><FONT  COLOR='#000000' FACE='Arial' SIZE='3'>"+quizTitle+"</FONT></B>");
  doc.writeln("</TD></TR></TABLE></TD></TR>");
  doc.writeln("<TR><TD bgcolor='#FFFFFF' nowrap><B><FONT  COLOR='#CC0000' FACE='Arial' SIZE='2'>&#160;&#160;Number of questions</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFFF' nowrap><B><FONT  COLOR='#CC0000' FACE='Arial' SIZE='2'>&#160;&#160;"+(questions-invisibleQuests)+"</FONT></B></TD></TR>");
  if (identityName!="") {
  doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;Candidate name</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFDD' ><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;"+identityName+"</FONT></B></TD></TR>");
  }
  doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;Right Answers</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;"+nc+"</FONT></B></TD></TR>");
  doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;Wrong Answers</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;"+ns+"</FONT></B></TD></TR>");
  doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;Unmarked questions</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;"+falseQuests+"</FONT></B></TD></TR>");
    percentage = Math.floor(nc * 100/ (nc+ns+falseQuests));
  doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;Right Answers</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;"+percentage+" %</FONT></B></TD></TR>");
  if (maxtime>0) {
  doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;Time elapsed</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;"+getTimeString(deltatime)+"</FONT></B></TD></TR>");
  }
  doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;Date</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFDD' nowrap><B><FONT  COLOR='#000000' FACE='Arial' SIZE='2'>&#160;&#160;"+DataToStringa()+"</FONT></B></TD></TR>");
  if (computeMarkErr==0) {
  doc.writeln("<TR><TD bgcolor='#FFFFFF' nowrap><B><FONT  COLOR='#CC0000' FACE='Arial' SIZE='2'>&#160;&#160;MARK</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFFF' nowrap><B><FONT  COLOR='#CC0000' FACE='Arial' SIZE='2'>&#160;&#160;"+GetVoto(voto)+"</FONT></B></TD></TR>");
  } else {
  doc.writeln("<TR><TD bgcolor='#FFFFFF' nowrap><B><FONT  COLOR='#CC0000' FACE='Arial' SIZE='2'>&#160;&#160;MARK</FONT></B></TD>");
  doc.writeln("    <TD bgcolor='#FFFFFF' nowrap><B><FONT  COLOR='#CC0000' FACE='Arial' SIZE='2'>&#160;&#160;No mark</FONT></B></TD></TR>");
  }
  doc.writeln("</TABLE></TD></TR></TABLE></TD></TABLE></center>");
}

function EndQuiz() {
 completeInitValuate();
 FinalActions();
}

function FinalActions() {
 voto = ComputeMarks();
 PrintResults();
}
function PrintTrueOrFalse(documento,flag) {
  if (flag==1) documento.write("<FONT class='report_ansText'>T</FONT>");
  else if (flag==0) documento.write("<FONT class='report_ansText'>F</FONT>");
}
function PrintATagLinkBack(documento) {
 return;
}

function init_valid()
{
 for (var i=0;i<questions;i++) {
   valid[i]=0;
   pesi[i]=0;
   nScore[i]=0;
   maxScore[i]=0;
 }
 nc = 0;
 ns = 0;
 nr = questions-0;
 voto = 0;
 computeMarkErr = 0;
 window.status='';
}
function initShortQuestion() {
 qstHead[0]="Now that I'm working I hardly have... free time.";
 qstHead[1]="She is . . . any other assistant he's ever had.";
 qstHead[2]="They always lock the storeroom as they are afraid ….. .";
 qstHead[3]="His mother told him that he needed….his room.";
 qstHead[4]="The teacher predicted that. . . would fail the exam.";
 qstHead[5]="The father walked slowly so the children could…. .";
 qstHead[6]="Finding a job nowadays is more difficult than…. .";
 qstHead[7]="Why didn't he take the dog out?' 'I guess…..'";
 qstHead[8]="'What is this dog doing here' 'I don't know. I wonder ……'.";
 qstHead[9]="'Are Jack and Suzy coming tonight?' 'From what I hear….'.";
 qstHead[10]="'It's cold in here!'  'Would you mind . . . the central heating?'";
 qstHead[11]="'I hear Peter had an accident.'  '….call him and see how he is?'";
 qstHead[12]="Mr. Black broke his leg and…..hospital in an ambulance.";
 qstHead[13]="By 11 o'clock, she…..more than twenty letters.";
 qstHead[14]="'Could you do it for me, please? 'Of course,….you want.'";
 qstHead[15]="I don't think her mother approves…..her new boyfriend.";
 qstHead[16]="'She's still not feeling better.' 'I advised . . . a doctor.'";
 qstHead[17]="She wishes… . so she could play on the national  volleyball  team next year.";
 qstHead[18]="……the storm, we took a ride in the country.";
 qstHead[19]="'I think I saw Helen yesterday.' 'You….. . She's away on business.'";
 qstHead[20]="'Have you heard from Ross lately?'  'Yes, he. . . me once a week, no matter where he's working.'";
 qstHead[21]="'How much more work have you got?'  'By the time. . . home, I'll have everything finished.'";
 qstHead[22]="'I've decided to go to medical school.'  'Are you sure?....is a big responsibility.'";
 qstHead[23]="'Why are you so depressed?'  'I'm not used to . . . everything by myself.'";
 qstHead[24]="What shall we do tonight?  'I suggest. . . the evening at home for a change.'";
 qstHead[25]="'Look at you! You're soaking wet!'  'As soon as I dry off, . . . you what happened!'";
 qstHead[26]="'You mean you haven't heard that Tim won the lottery?'  'It seems I'm always the last….'";
 qstHead[27]="'Do you think we'll have enough money for the rent this month?' '….'";
 qstHead[28]="'I hear there's a new restaurant at the mall.' 'Let's try it,...?'";
 qstHead[29]="Can I help you?'  'Yes, could you tell me how long...";
 qstHead[30]="She warned them.....in the park after sunset.";
 qstHead[31]="It wasn't hard to see that he. . .. in the garden all morning.";
 qstHead[32]="He…. . at the same job for more than twenty years now.";
 qstHead[33]="She said that she would. . . as soon as he got home.";
 qstHead[34]="……had he opened the door than the phone rang.";
 qstHead[35]="Vocabulary  The children are outside playing in the _____ .";
 qstHead[36]="I was _____ to hear that she had given birth to twins.";
 qstHead[37]="My favorite T-shirt….. in the laundry!";
 qstHead[38]="The police searched the house _____ , but they didn't find anything.";
 qstHead[39]="We really must _____ an effort to control our spending.";
 qstHead[40]="Everyone is _____ to be here by 8:30 a.m.";
 qstHead[41]="Special training is needed before you can _____ this machinery.";
 qstHead[42]="The team has players of many different _____ .";
 qstHead[43]="We each _____ $5 to buy her a gift.";
 qstHead[44]="It's hard for me to _____ a map correctly.";
 qstHead[45]="That's the whole story in a…. .";
 qstHead[46]="I don't have time to _____ up with all the latest news.";
 qstHead[47]="Let's clean this place up. It's……!";
 qstHead[48]="Our neighbors are really…..They often make a lot of noise late at night.";
 qstHead[49]="I didn't feel like going shopping, but my friends _____ me into it.";
 qstHead[50]="I've sent away for more information, but I haven't had _____ yet.";
 qstHead[51]="I need a new driver's license. My old one has ____ .";
 qstHead[52]="She went to bed very late, so _____ ,she's tired this morning.";
 qstHead[53]="Tom jumped into the water without _____ .";
 qstHead[54]="Here's their phone number in case of….. .";
 qstHead[55]="I hope Robert gets the prize. He…..it.";
 qstHead[56]="Everyone admires Mary because she has very…..principles.";
 qstHead[57]="108. They brought back a lot of _____ from South America.";
 qstHead[58]="You won't be able to _____ away with writing short answers on this test.";
 qstHead[59]="That red jacket looks good on you. Red really…..you.";
 qstHead[60]="This bookshop has a fantastic _____ of fiction.";
 qstHead[61]="This painting is _____. It's the only one that was done in watercolors.";
 qstHead[62]="That old song always makes me feel…. .";
 qstHead[63]="He cared for his aging grandfather with great…. .";
 qstHead[64]="I think it's _____ to fire a person just because he makes one mistake.";
 qstHead[65]="Did you hear the weather _____ for tomorrow?";
 qstHead[66]="I saw a traffic accident this morning. It gave me a terrible _____ .";
 qstHead[67]="After hearing the evidence, we must…..that he is guilty.";
 qstHead[68]="My father's leaving on a business _____ tomorrow.";
 qstHead[69]="He was fired because of his…. .";
 qstHead[70]="TEST ECCE 01 Reading Pssage 1A  I believe I could still take that walk with my eyes closed. First of all I used to go up the extension of Avonmore Road, past two lamp-posts, thinking that the newer odd numbers looked more interesting houses than the stiff line of even numbers where we lived. However, none of the odd numbers was anything like as interesting as the house of Hope-Pinker, who was an artist in stone, and if the door to his workroom was open I would be able to catch sight of that great marble lion. Then came a quick look at the sorting-office, always a scene of great activity, it seemed, with postmen hurrying in and emptying bags of letters and with rows of clerks stamping those letters with postmarks. By the sorting-office, Avonmore Road made a sudden right-angled turn past a broken-down tarred fence. Through gaps in this fence could be seen a large shadowy garden, covered with pale green under trees with trunks as black as coal. Beyond the garden was a large decayed house with big bare windows showing here and there among the creeper which covered it.   After this Avonmore Road continued on the right in the same direction as the extension. The houses were smaller now, and the bricks of which they were built were a deeper red than those of 54 Avonmore Road and its neighbours, They had no rooms below ground level and one could see into their dining-rooms, so close were they to the pavement. Opposite were the odd number houses, also without rooms below ground level. After 2 Avonmore Road there was a narrow stretch of waste ground in which was a tall advertisement-board, the pictures on which were sometimes of great interest. On the other side of the road was the back of a large council school. Beyond the school were Avonmore Mansions, seeming tall and splendid with their yellowish bricks. I knew that these were fiats and I had heard them spoken of in our kitchen as an up-to-date but unnatural way of living. However, I thought that the doorkeeper, sitting on a chair in the entrance hall, must be a great protection against thieves; I used to wish that we lived in the safety of a fiat. Then, to the right, there came about half a dozen shops, one of them a tobacconist's, one a second hand bookshop, one an ice-cream shop with a barber's at the back, and one an umbrella shop which showed in the window a row of thick heavy sticks called Night Companions. They were priced at a shilling each. I longed for one of these Night Companions to sleep beside me, and to my joy one afternoon Nanny, having stayed out longer than usual on her walk, arrived with two of these Night Companions, one of which she presented to me and the other to my brother Frank, who was not yet four years old. Frank's Night Companion looked much fiercer than mine its club-head was more knotted and it was stained a darker shade than the stem. My Night Companion looked mild and clean-shaven beside it. When Nanny bought the sticks I was stupid enough to show my preference for the fiercer-looking one, and that of course ruined my chances of being given it as my protector. Now please click on the correct answer A, B, C or D.  As he went past Hope-Pinker's house he liked to try to look at.... .";
 qstHead[71]="At the sorting-office, you could see postmen…. .";
 qstHead[72]="It looked as if the big house beyond the garden was empty, because…";
 qstHead[73]="One could see into the dining-rooms of the smaller houses because…";
 qstHead[74]="What does the writer tell us about the piece of waste land?";
 qstHead[75]="The flats called Avonmore Mansions were…";
 qstHead[76]="What opinion about living in flats had the writer heard?";
 qstHead[77]="He wanted a night companion because…";
 qstHead[78]="Reading Passage 1B A ->  MURDER by Dean Koontz  Martin Stillwater has a vivid imagination. It charms his loving wife, delights his two little daughters and gives him all the inspiration he needs to write his highly successful mystery novels. But maybe Martin's imagination is a hit too vivid. One rainy afternoon a terrifying incident makes him question his grip on reality. A stranger breaks into his house, accusing Martin of stealing his wife, his children - and his life. Claiming to be the real Martin Still water, the intruder threatens to take what is rightfully his. The police think Martin's imagining things, but Martin and his family have no choice but to believe the stranger's threat and run for their lives. But wherever they go wherever they hide he finds them.   B ->JUDGMENT IN STONE  by Ruth Rendell  Four members of the Coverdale family - George, Jacqueline, Melinda and Giles died in the space of fifteen minutes on the 14th of February, St. Valentine's Day, Eunice Parchman, their housekeeper, and her friend Joan Smith shot them down on a Sunday evening while they were watching opera on television. Two weeks later .Eunice was arrested for the crime. But the tragedy neither began nor ended there..   C ->LULLABY by d McBain  There have been happier New Year's Eves for the cops of the 87th Precinct  A wealthy young couple returns home from a party to discover their baby-sitter and their infant child brutally murdered. Meanwhile out e streets, warring gangs plan to ring in the New Year with blood and fire. There's a sinister song of death and destruction echoing in the streets on this fearful First and it Isn't Auld Lang Syne!  D -> BODY OF TRUTH Houston homicide detective Stuart Haydon deals in lost souls, and Lena Muller, daughter of a prominent local family, is about as lost as you can get. Three months have passed since Lena went out to meet an old friend, and she has yet to return. Haydon is determined to bring her home. But word has come that she has surfaced in a place far away from Houston and way out of his league. To find her he must head for Guatemala, a land where people never die… . they simply disappear Following a trail of lovers and a string of brutal murders, Haydon is drawn  into a world of everyday violence and corruption and soon finds that he is seeking the body of truth at the heart of a labyrinth of lies.   E -> THE BURDEN OF PROOF Returning home from a trip, lawyer Alexandro Stern finds his wife dead. She has committed suicide, leaving behind a note which says only, 'Can you forgive me?' Why did she take her own life? What had she planned to do with the $500,000 she had withdrawn from the bank a few days before? And what has happened to the check? The harder he tries to work things out  the more questions rise to the surface.   F ->THE ASSASSIN by Thomas Gifford  When lawyer Ben Driskill's sister is murdered, he sets out to find the murderer himself - and uncovers an explosive secret:  his sister, an outspoken nun, had been on the trail of the Assassin, an age-old brotherhood of killers once hired by the Church to protect it in dangerous times. But whose orders do they obey now?   Please choose the correct answer A, B, C or D Which would you choose for a friend who is interested in how big-city police solve crimes?";
 qstHead[79]="Which might you consider for a lawyer who loves mysteries about lawyers?";
 qstHead[80]="Which would you choose for a mystery-loving friend who is also interested in the social problems of Third World countries?";
 qstHead[81]="Which book has a historical angle?";
 qstHead[82]="Which would you not choose for a nervous friend with a strange cleaning woman?";
 qstHead[83]="Which might you choose for a friend who is a writer?";
 qstHead[84]="Which might you choose for a sociologist interested in teenage gang warfare?";
 qstHead[85]="Which would you choose for a friend who is interested in secret organizations?";
 qstHead[86]="Which would you choose for a friend wanting something 'seasonal' to read during the Christmas school break.";
 qstHead[87]="Which book doesn't involve a murder?";
 qstHead[88]="Which book begins with a search for a missing person?";
 qstHead[89]="Reading Passage 1C BLOOD DRIVE THIS WEEK General Information  Human blood is manufactured in only one place - the human body. No matter how much money or how much medical insurance you have, if you need a blood transfusion after an accident or for an operation, you will be dependent on blood donations from other people. There is a continuous demand for blood.  Every human being belongs to one of four blood types: A, B, AB or 0. Out of every 100 people, about 45 will have type 0 and about 40 type A. Ten will have type B and only five type AB (which is a relatively rare blood type.) It is important to know your blood type when you receive a transfusion in order to avoid the body's negative reaction to an incompatible type.  People with type 0 blood are known as universal donors, that is, they can donate red cells to anyone else. However, they can only receive them from other type 0 people. Those whose blood belongs to the AB type are known as universal recipients. In other words, they can receive red cells from anyone but can only donate them to other type AB people.   Who may donate blood?  Donors must meet the following criteria:  Minimum age: 17  Minimum weight: 48-50 kilograms  Have not donated blood in the preceding two months  General good health. You might not be accepted as a donor for medical reasons. These may be temporary, such as a short illness or having had dental surgery, or they may be permanent, such as certain hereditary diseases or testing positive for HIV.   What is the procedure when you come to donate blood? You will:   Identify yourself by providing personal details such as your name, age, etc.   Be asked about your medical history.  Have one drop of blood taken and analyzed for hemoglobin.  Have your blood pressure, body temperature and pulse checked.  Have a needle inserted into your arm and the blood drawn into a special bag. This stage takes 7-10 minutes.  Have a short rest and some refreshments  What happens to the blood after you donate?  First the blood is tested to check your blood type and to see whether you are a carrier of any disease which would make your donation unacceptable. After that, the blood is usually separated into the following components:  Red cells, which transport oxygen and clear away carbon dioxide.  White cells, which fight infection.  Plasma, which is mainly water. Plasma carries other substances in the blood.  Platelets which are colorless cells that control bleeding.  Each of these components can be used separately as needed, or the donation can be used as 'whole blood' for one patient.   And finally...  People are sometimes concerned about the possible risks involved in blood donation. There is absolutely no danger of contracting AIDS or any other disease through giving blood. All the equipment is new, sterile, and disposable. Everything is used only once. Your blood is taken by a trained technician, and the procedure is simple and painless.  Donating blood is an act of kindness and compassion. You are assisting hospital patients in need, and, if you ever need a blood transfusion, you will be grateful that others have donated blood.  For further information, call 1-800-933-2566 nationwide, or call the Blood Center nearest you    Please click on the right answer Instructions: You are visiting a cousin in the USA. The blood bank is having a special drive to collect blood from donors next week. You and your cousin are prepared to give blood, but you have never done it before, and you want to know more about it. Look at the questions below and try to find the answers in the information on the opposite page.   Please choose the correct answer A, B, C or D.   It is important to donate blood because…";
 qstHead[90]="Knowing your blood group is important because...";
 qstHead[91]="The most common blood type is...";
 qstHead[92]="If you have blood type 0 you can receive blood from...";
 qstHead[93]="If you want to donate blood, you must...";
 qstHead[94]="How often can you donate blood?";
 qstHead[95]="The actual taking of blood is done...";
 qstHead[96]="Immediately after the donation you should...";
 qstHead[97]="Your blood is tested for blood type...";
 qstHead[98]="From the text we can understand that...";
 qstHead[99]="According to the text, donating blood...";
}


function PrintOpenHTML(documento,title,closeHead) {
  documento.writeln ('<HTML>');
  documento.writeln ('<HEAD>');
  documento.writeln ("<TITLE>"+title+"</TITLE>");
  documento.writeln ('<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">');
  documento.writeln ("<META name='generator' content='QuizFaber 2.12.2'>");
  if (closeHead==1)
    documento.writeln ('</HEAD>');
}
function GetTypeOfSubstitution(aMark) { return 0; }

function Constructor() {
  valid = new init_array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  nScore = new init_array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  maxScore = new init_array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  qstHead = new init_array("","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","");
  initShortQuestion();
  groups = new init_array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  pesi = new init_array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  allAnsReport = new init_array(100);
  ordineDomande = new init_array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99);
  typeOfQuest = new init_array(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
  omitPoint = new init_array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
}

