<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<META name="Author" content="Criado usando Galli's QuizFaber 2.12.2">
<META name="generator" content="Galli's QuizFaber 2.12.2">
<META name="keywords" content="quiz">
<META name="description" content="eeeeeeeeeeeee">
<TITLE>eeeeeeeeeeeee</TITLE>
<SCRIPT LANGUAGE='JavaScript'>
<!--
var qmakeVers = '2.12.2';
var qmakeProgName = "Galli's QuizFaber";
var qmakeURL = 'www.lucagalli.net/';
var dhtmlEnabled = 0;
var frameEnabled = 1;
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=1;
var qstHead;
var pageWidth = 80;
var groups;
var quizTitle="eeeeeeeeeeeee";
var maxtime=1800;
var showTimeout = 1;
var keycode;
var keyword = 'syskey';
var los = 0;
var maxvoto = 10;
var minvoto = 0;
var roundvoto = 1;
var voto = 0;
var silent = 0;
var quizRetire = 0;
var showReport = 1;
var ncols_report = 1;
var valutaQuiz = 1;
var falseQuests = 0;
var invisibleQuests = 0;
var auto_repeat = 0;
var man_repeat = 0;
var n_repeat = 0;
var reviewQuiz = 0;
var markPercentage = 0;
var incl_close_btn = 1;
var incl_print_btn = 1;
var incl_linkback = 0;
var finalMess = '';
var printCpRg=1;
var filename = 'eeee';
var topChartFile='';
var pesi;
var allAnsReport;
var author = '';
var mediaDir = 'media';
var questSlide = 0;
var lockRightAns = 0;
var resultBoxKind = 0;
var reportNotation = 1;
var remRepAlways = 0;
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 = "Domingo"; break;
case 1: nome = "Segunda-feira"; break;
case 2: nome = "Terça-feira"; break;
case 3: nome = "Quarta-feira"; break;
case 4: nome = "Quinta-feira"; break;
case 5: nome = "Sexta-feira"; break;
case 6: nome = "Sábado"; break;
}
strData = nome+", "+obj.getDate();
mese = obj.getMonth();
switch(mese) {
case 0: nome = "Janeiro"; break;
case 1: nome = "Fevereiro"; break;
case 2: nome = "Março"; break;
case 3: nome = "Abril"; break;
case 4: nome = "Maio"; break;
case 5: nome = "Junho"; break;
case 6: nome = "Julho"; break;
case 7: nome = "Agosto"; break;
case 8: nome = "Setembro"; break;
case 9: nome = "Outubro"; break;
case 10: nome = "Novembro"; break;
case 11: nome = "Dezembro";
}
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("Aviso: impossível calcular o resultado final");
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("Acabou o tempo!");
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("Introduza o seu nome :","");
if ((userName=="")||(userName==null)) {
userName = "desconhecido";
}
identityName = userName;
userName = "Nome="+userName;
}
function AskMeKeyword(word,digest)
{
if (word=='') {
keyword = window.prompt("Introduza a password:","");
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("Ops!Você já respondeu à pergunta");
}
function IncompletedQuest()
{
window.alert("Resposta incompleta. Por favor, responda a todas as opções");
}
function Retire()
{
if (window.confirm("Tem a certeza?")) {
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="para verificar a resposta : "+nr+" perguntas.";
return;
}
msg="em "+(questions-nr)+" perguntas, ";
if (nc>1) msg+=nc+" Correcto e ";
if (nc==1) msg+=" apenas um exacto e ";
if (nc==0) msg+=" nada exacto e ";
if (ns>1) msg+=ns+" Incorrecto .";
if (ns==1) msg+=" apenas um incorrecto.";
if (ns==0) msg+=" nada incorrecto.";
msg+=" Você deve responder a ";
if (nr>1) msg+=nr+" perguntas.";
else msg+=" um pergunta.";
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 += "Este quiz foi criado ";
if (author!='') {
msg += "por <B>"+author+"</B> ";
}
msg += "com <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("Resposta correcta");
}
else if (valid[qst_num]==-1) {
doc.writeln("Resposta incorrecta");
}
else if (valid[qst_num]==2) {
doc.writeln("Pergunta não validada");
}
else if (valid[qst_num]==3) {
if (typeOfQuest[qst_num]==2) {
doc.writeln("Respostas correctas "+nScore[qst_num]+" em "+maxScore[qst_num]);
}
else if (typeOfQuest[qst_num]==4) {
doc.writeln("descubra as palavras "+nScore[qst_num]+" em "+maxScore[qst_num]);
}
else if (typeOfQuest[qst_num]==5) {
doc.writeln("Fazer a correspondência "+nScore[qst_num]+" em "+maxScore[qst_num]);
}
}
else if (valid[qst_num]==5) {
doc.write("pontuações "+nScore[qst_num]);
if (groups[qst_num]==0) {
doc.writeln(" (Pontuação "+maxScore[qst_num]+")");
}
else if (groups[qst_num]==1) {
doc.writeln("<BR>Resultado adicionado à pontuação anterior");
}
else if (groups[qst_num]==2) {
doc.writeln("<BR>Pontuação (cálculos das respostas às perguntas seguintes): "+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='Resposta selecionada'>";
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='Resposta correcta'>";
responseImageKo = mediaDir+"/ko.gif";
tagResponseImageKo = "<IMG SRC="+unescape("%22")+responseImageKo+unescape("%22")+" ALIGN='CENTER' ALT='Resposta incorrecta'>";
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()'>IMPRIMIR</A>");
count++;
}
if (man_repeat) {
if (count>0) doc.writeln(" | ");
doc.writeln("<a href='javascript:RepeatQuiz()'>REPETIR</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()'>FECHAR</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>Resultado do Quiz</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);
if (silent==1) {
if (PrintAnswer.arguments.length>1)
textField.value = "Resposta selecionada";
}
else {
if (valid[n]==1) {
if (PrintAnswer.arguments.length>1)
textField.value = "Resposta correcta";
msg = "<FONT size=5 face='Arial' color='#000080'>Excelente! Resposta correcta</FONT>";
}
else {
msg = "Incorrecto! A resposta correcta era " + getListOfRightAns(n);
if (PrintAnswer.arguments.length>1)
textField.value = msg;
msg = "<FONT size=5 face='Arial' color='#A52A2A'>" + msg + "</FONT>";
}
PrintAnswerOnTopFrame(msg,explan,GetSoundName(n));
}
end_test = CountAnswers();
PrintStatusBar();
PrintBottomFrame();
if (end_test==1) {
window.status = "";
window.alert("Já respondeu a todas as perguntas");
EndQuiz();
}
return end_test;
}
function PrintOpenAnswer(n,outMsg) {
outMsg.value = "Questão respondida";
end_test = CountAnswers();
PrintStatusBar();
PrintBottomFrame();
if (end_test==1) {
window.status = "";
window.alert("Já respondeu a todas as perguntas");
EndQuiz();
}
return end_test;
}
function PrintBooleanAnswer(n,textField)
{
var msg,msg2,msgFormat;
var explan= new initOneElementVector();
explan[0] = "";
if (silent==0) {
msg = "Respostas correctas " + nScore[n] + " / " + getNumAns(n);
textField.value = msg;
msgFormat = "<FONT size=5 face='Arial' color='#696969'>" + msg + "</FONT>";
if (nScore[n]<getNumAns(n)) {
msg2 = "Respostas incorrectas : " + getListOfMistake(n);
textField.value += " ; " + msg2;
explan[0] = msg2;
}
PrintAnswerOnTopFrame(msgFormat,explan,GetSoundName(n));
}
else
textField.value = "Resposta selecionada";
end_test = CountAnswers();
PrintStatusBar();
PrintBottomFrame();
if (end_test==1) {
window.status = "";
window.alert("Já respondeu a todas as perguntas");
EndQuiz();
}
return end_test;
}
function PrintQuestionScore(n,textField)
{
var msg,msgFormat;
var explan = new initListOfRemark(n);
if (silent==0) {
msg = "Pontuação : " + nScore[n];
if (groups[n]==0)
msg += " (Pontuação "+maxScore[n]+")";
textField.value = msg;
msgFormat = "<FONT size=5 face='Arial' color='#000080'>" + msg + "</FONT>";
if (getGuessAns(n)<getNumAns(n))
msgFormat += "<BR>A resposta correcta era " + getListOfRightAns(n);
PrintAnswerOnTopFrame(msgFormat,explan,GetSoundName(n));
}
else
textField.value = "Resposta selecionada";
end_test = CountAnswers();
PrintBottomFrame();
PrintStatusBar();
if (end_test==1) {
window.status = "";
window.alert("Já respondeu a todas as perguntas");
EndQuiz();
}
return end_test;
}
function PrintAnswerOnTopFrame(message,explan,soundFile)
{
var i;
frames.quiz_top.document.clear();
frames.quiz_top.document.open();
PrintOpenHTML(frames.quiz_top.document,"",1);
frames.quiz_top.document.writeln (bodyTagFrame2);
frames.quiz_top.document.writeln ("<center>");
frames.quiz_top.document.writeln (message+"<BR>");
for (i=0;i<explan.length; i++) {
if (explan[i]!="")
frames.quiz_top.document.writeln (explan[i]+"<BR>")
}
frames.quiz_top.document.writeln ("</center>");
if (soundFile!='')
frames.quiz_top.document.writeln ("<EMBED SRC='"+soundFile+"' AUTOSTART=TRUE HIDDEN=TRUE>");
frames.quiz_top.document.writeln ("</body></html>");
frames.quiz_top.document.close();
}
function PrintBottomFrame()
{
var msg;
frames.quiz_status.document.clear();
frames.quiz_status.document.open();
PrintOpenHTML(frames.quiz_status.document,"",1);
frames.quiz_status.document.writeln (noBorderBodyTagFrame2);
frames.quiz_status.document.writeln ("<form name='domanda'><table width='100%'><TR>");
if (maxtime>0) {
frames.quiz_status.document.writeln ("<td width='20%' align='CENTER'><INPUT TYPE='TEXT' SIZE=10 NAME='clock'></TD>");
}
else {
frames.quiz_status.document.writeln ("<td width='20%'></TD>");
}
if (silent==0) {
msg="<td width='23%' align='CENTER'><FONT FACE='Arial' SIZE='2'><B>Correcto </B> : "+nc+"</FONT></TD>";
msg+="<td width='23%' align='CENTER'><FONT FACE='Arial' SIZE='2'><B>Incorrecto </B> : "+ns+"</FONT></TD>";
msg+="<td width='23%' align='CENTER'><FONT FACE='Arial' SIZE='2'><B>faltam </B> : "+nr+"</FONT></TD>";
}
else {
msg="<td width='69%' align='LEFT'>para verificar a resposta :<FONT SIZE=+1>"+nr+"</FONT></TD>";
}
if (quizRetire==1)
msg+="<td width='11%' align='RIGHT'><INPUT TYPE='BUTTON' VALUE='Sair ' OnClick='parent.Retire()'></TD>";
else
msg+="<td width='11%'></TD>";
frames.quiz_status.document.writeln (msg+"</TR></TABLE></FORM></body></html>");
frames.quiz_status.document.close();
}
function PrintWrongKeyword()
{
frames.quiz_top.document.clear();
PrintOpenHTML(frames.quiz_top.document,"",1);
frames.quiz_top.document.writeln (bodyTagFrame2);
frames.quiz_top.document.writeln ("</body></html>");
frames.quiz_top.document.close();
frames.quiz_main.document.clear();
frames.quiz_main.document.open();
PrintOpenHTML(frames.quiz_main.document,"",1);
frames.quiz_main.document.writeln (bodyTagFrame1);
frames.quiz_main.document.writeln("<CENTER><FONT SIZE=6 FACE='Arial' COLOR='#FF0000'>Cuidado!</FONT><BR>");
frames.quiz_main.document.writeln ("<FONT SIZE=+2>Password incorrecta</FONT><BR>");
frames.quiz_main.document.writeln ("Não pode avançar no quiz<BR>");
frames.quiz_main.document.writeln ("Para mais informação, contacte o autor do quiz<BR>");
frames.quiz_main.document.writeln("<P><INPUT TYPE='BUTTON' VALUE='FECHAR' OnClick='top.close()'>");
frames.quiz_main.document.writeln("</CENTER>");
frames.quiz_main.document.writeln ("</body></html>");
frames.quiz_main.document.close();
PrintCopyright();
}
function PrintNoReload()
{
frames.quiz_top.document.clear();
PrintOpenHTML(frames.quiz_top.document,"",1);
frames.quiz_top.document.writeln (bodyTagFrame2);
frames.quiz_top.document.writeln ("</body></html>");
frames.quiz_top.document.close();
frames.quiz_main.document.clear();
frames.quiz_main.document.open();
PrintOpenHTML(frames.quiz_main.document,"",1);
frames.quiz_main.document.writeln (bodyTagFrame1);
frames.quiz_main.document.writeln("<CENTER><BR><BR><FONT SIZE=6 FACE='Arial' COLOR='#FF0000'>Cuidado!</FONT><BR>");
frames.quiz_main.document.writeln ("<FONT SIZE=+2>É impossível reiniciar o quiz</FONT><BR>");
frames.quiz_main.document.writeln ("É impossível iniciar o quiz<BR>");
frames.quiz_main.document.writeln ("Para mais informação, contacte o autor do quiz<BR>");
frames.quiz_main.document.writeln("<P><INPUT TYPE='BUTTON' VALUE='FECHAR' OnClick='top.close()'>");
frames.quiz_main.document.writeln("</CENTER>");
frames.quiz_main.document.writeln ("</body></html>");
frames.quiz_main.document.close();
PrintCopyright();
}
function PrintCopyright()
{
frames.quiz_status.document.clear();
frames.quiz_status.document.open();
PrintOpenHTML(frames.quiz_status.document,"Info",1);
frames.quiz_status.document.writeln (bodyTagFrame2);
if (printCpRg==1) {
frames.quiz_status.document.writeln(GetCopyrightMsg());
}
frames.quiz_status.document.writeln ("</body></html>");
frames.quiz_status.document.close();
}
function AskPrintQuiz() {
if (window.confirm("Imprimir o quiz?")) {
window.print();
window.alert("FECHAR IMPRIMIR");
}
}
function PrintResults()
{
PrintResultOnTopFrame();
if (GetTypeOfSubstitution(voto)==4) {
document.location = GetLinkFromMark(voto);
window.status = "";
PrintCopyright(1);
return;
}
frames.quiz_main.document.close();
frames.quiz_main.document.clear();
frames.quiz_main.document.open();
PrintOpenHTML(frames.quiz_main.document,"Resultado do Quiz",0);
PrintReportStyle(frames.quiz_main.document,compressReport);
PrintJSResult(frames.quiz_main.document);
frames.quiz_main.document.writeln("</head>");
frames.quiz_main.document.writeln(bodyTagFrame1);
if (valutaQuiz==1) {
if (GetTypeOfSubstitution(voto)<=2) {
PrintResultTopBar(frames.quiz_main.document);
PrintResultsTable(frames.quiz_main.document);
if (showReport==1)
PrintReport(frames.quiz_main.document,compressReport);
}
else if (GetTypeOfSubstitution(voto)==3) {
frames.quiz_main.document.writeln("<center><TABLE WIDTH='"+pageWidth+"%' BORDER=0><TD ALIGN='LEFT'>");
frames.quiz_main.document.writeln (GetRemFromMark(voto));
frames.quiz_main.document.writeln("</TD></TABLE></center>");
}
else {
}
}
else {
frames.quiz_main.document.writeln("<center><TABLE WIDTH='"+pageWidth+"%' BORDER=0><TD ALIGN='LEFT'>");
frames.quiz_main.document.writeln(finalMess);
frames.quiz_main.document.writeln("</TD></TABLE></center>");
}
PrintLinkBack(frames.quiz_main.document);
frames.quiz_main.document.writeln ("</body></html>");
frames.quiz_main.document.close();
window.status = "";
PrintCopyright(1);
}
function PrintResultOnTopFrame ()
{
frames.quiz_top.document.clear();
frames.quiz_top.document.open();
PrintOpenHTML(frames.quiz_top.document,"Resultado do Quiz",1);
frames.quiz_top.document.writeln (bodyTagFrame2);
frames.quiz_top.document.writeln("<CENTER><FONT SIZE=4 FACE='Arial'><B><I>Resultado do Quiz</I></B></FONT></CENTER>");
frames.quiz_top.document.writeln ("</FONT></CENTER>");
frames.quiz_top.document.writeln ("</body></html>");
frames.quiz_top.document.close();
}
function SetClock(timeStr)
{
frames.quiz_status.document.domanda.clock.value = timeStr;
}
function GetSoundName(n)
{
if ((valid[n]==-1)||(maxScore[n]==minvoto))
return errSound;
if ((valid[n]==1)||(maxScore[n]==maxvoto))
return okSound;
if ((valid[n]==3)||(valid[n]==5))
return warnSound;
return warnSound;
}
function showTooltip (strTooltip) {
frames.quiz_top.document.clear();
PrintOpenHTML(frames.quiz_top.document,"",1);
frames.quiz_top.document.writeln (bodyTagFrame2);
frames.quiz_top.document.writeln ("<CENTER>");
frames.quiz_top.document.writeln ("<I>Pistas</I>:<BR>"+strTooltip);
frames.quiz_top.document.writeln ("</CENTER>");
frames.quiz_top.document.writeln ("</body></html>");
frames.quiz_top.document.close();
}
function clearTooltip () {
setTimeout(deleteTooltip,2000);
}
function deleteTooltip () {
frames.quiz_top.document.clear();
PrintOpenHTML(frames.quiz_top.document,"",1);
frames.quiz_top.document.writeln (bodyTagFrame2);
frames.quiz_top.document.writeln ("</body></html>");
frames.quiz_top.document.close();
}
function completeInitValuate() {
if (valid[0]==0) {
allAnsReport[0] = new frames.quiz_main.initValuate1();
doValuate(0,frames.quiz_main.document.domanda.score1,frames.quiz_main.document.domanda.risposta1);
}
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'>  Número de perguntas</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFFF' nowrap><B><FONT COLOR='#CC0000' FACE='Arial' SIZE='2'>  "+(questions-invisibleQuests)+"</FONT></B></TD></TR>");
if (identityName!="") {
doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  Nome</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFDD' ><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  "+identityName+"</FONT></B></TD></TR>");
}
doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  Respostas correctas</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  "+nc+"</FONT></B></TD></TR>");
doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  Respostas incorrectas</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  "+ns+"</FONT></B></TD></TR>");
doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  Perguntas não respondidas</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  "+falseQuests+"</FONT></B></TD></TR>");
if (maxtime>0) {
doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  Tempo de preenchimento</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  "+getTimeString(deltatime)+"</FONT></B></TD></TR>");
}
doc.writeln("<TR><TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  Data</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFDD' nowrap><B><FONT COLOR='#000000' FACE='Arial' SIZE='2'>  "+DataToStringa()+"</FONT></B></TD></TR>");
if (computeMarkErr==0) {
doc.writeln("<TR><TD bgcolor='#FFFFFF' nowrap><B><FONT COLOR='#CC0000' FACE='Arial' SIZE='2'>  Pontuação</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFFF' nowrap><B><FONT COLOR='#CC0000' FACE='Arial' SIZE='2'>  "+GetVoto(voto)+"</FONT></B></TD></TR>");
} else {
doc.writeln("<TR><TD bgcolor='#FFFFFF' nowrap><B><FONT COLOR='#CC0000' FACE='Arial' SIZE='2'>  Pontuação</FONT></B></TD>");
doc.writeln(" <TD bgcolor='#FFFFFF' nowrap><B><FONT COLOR='#CC0000' FACE='Arial' SIZE='2'>  sem pontuação</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'>V</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]="eeeeeeeee";
}
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);
nScore = new init_array(0);
maxScore = new init_array(0);
qstHead = new init_array("");
initShortQuestion();
groups = new init_array(0);
pesi = new init_array(0);
allAnsReport = new init_array(1);
ordineDomande = new init_array(0);
typeOfQuest = new init_array(1);
omitPoint = new init_array(0);
}
//-->
</SCRIPT>
</HEAD>
<FRAMESET ROWS='60,*,30'>
<FRAME SRC='eeee2.htm' NAME='quiz_top' FRAMEBORDER='NO'>
<FRAME SRC='eeee1.htm' NAME='quiz_main'>
<FRAME SRC='eeee3.htm' NAME='quiz_status' FRAMEBORDER='NO' SCROLLING='NO'>
<NOFRAMES>Browser with no frames-enabled option</NOFRAMES>
</FRAMESET>
</HTML>
Nenhum comentário:
Postar um comentário