'; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += '
'; var QButtonsOpener = ''; var QButtonsCloser = ''; var TableOpener = '
'; TableOpener += ''; var QRow = ''; QRow += ''; var ARow = ''; var MARow = ''; var CheckButton = ''; TableCloser = '
[QNumber].  

[Question]
 

'; QRow += '
'; ARow += ''; ARow += ''; ARow += ''; ARow += '
        [Ans]
'; MARow += '[Ans]
'; CheckButton += ''; CheckButton += '
'; function ReduceItems(){ var ItemToDump=0; var j=0; while (I.length > QsToShow){ ItemToDump = Math.floor(I.length*Math.random()); for (j=ItemToDump; j<(I.length-1); j++){ I[j] = I[j+1]; } I.length = I.length-1; } } function Shuffle(InArray){ Temp = new Array(); var Len = InArray.length; var j = Len; for (var i=0; i
'; document.getElementById('FeedbackContent').innerHTML = Output; var FDiv = document.getElementById('FeedbackDiv'); //Calculate and set its left setting topZ++; FDiv.style.zIndex = topZ; //Position the feedback div pg = new PageDim(); FDiv.style.left = Math.floor(pg.W/3) + 'px'; FDiv.style.width = Math.floor(pg.W/3) + 'px'; //Set the top again in case the window has been resized if (is.ns){ FDiv.style.top = Math.floor(pg.H/3) + window.pageYOffset + 'px'; } else{ FDiv.style.top = Math.floor(pg.H/3) + document.body.scrollTop + 'px'; } FDiv.style.display = 'block'; document.getElementById('FeedbackOKButton').focus(); } function HideFeedback(){ document.getElementById('FeedbackOKButton').blur(); document.getElementById('FeedbackContent').innerHTML = ''; document.getElementById('FeedbackDiv').style.display='none'; document.getElementById('NextQButton').focus(); if (Finished == true){ Finish(); } } function WriteToInstructions(Feedback) { Feedback = '' + Feedback + ''; document.getElementById('InstructionsDiv').innerHTML = Feedback; } function WriteScore(Feedback) { Feedback = '' + Feedback + ''; document.getElementById('ScoreDiv').innerHTML = Feedback; } function StartUp(){ //IE bug avoidance -- remove bottom navbar if (is.ie){ if (document.getElementById('BottomNavBar') != null){ document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar')); } } if (is.ie){ document.attachEvent('onkeydown',SuppressBackspace); window.attachEvent('onkeydown',SuppressBackspace); } else if (is.ns){ window.addEventListener('keypress',SuppressBackspace,false); } //Try to get user name UserName = prompt('Nome Cognome Matricola: ',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ UserName = prompt('Nome Cognome Matricola: ',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ history.back(); } } //Reduce array if required if (QsToShow < I.length){ ReduceItems(); } //Shuffle stuff if required if (ShuffleQs == true){ I = Shuffle(I); } if (ShuffleAs == true){ for (var i=0; i= Status[QNum][1].length-1){ Status[QNum][0] = 1; for (var i=0; i-1){ FirstBit = InString.substring(0, i); LastBit = InString.substring(i + Token.length, InString.length); InString = FirstBit + Replacement + LastBit; i = InString.indexOf(Token); } return InString; } function ChangeQ(ChangeBy){ var NewNum = CurrQNum + ChangeBy; if ((NewNum >= 0)&&(NewNum=0; i--){ //Find any incorrect choices var b = eval('document.QForm.A_' + QNum + '_' + i); if (b != null){ //if it's wrong, count it if (b.checked == true){ Status[QNum][1][i] = 'C'; } else{ Status[QNum][1][i] = 'U'; } if (((b.checked == true) && (b.value == "0"))||((b.checked == false)&&(b.value == "1"))){ TotWrong++; } } } if (TotWrong == 0){ Output = DefaultRight; } else{ Output = DefaultWrong + '
' + (TotAns-TotWrong) + '/' + TotAns; } //If you haven't tried the question before if (Status[QNum][0] == 0){ if (TotWrong > 0){ Status[QNum][2]++; } if (TotWrong == 0){ Status[QNum][0] = 1; //Calculate the score for this question as a floating-point fraction of 1 Status[QNum][3] = ((Status[QNum][1].length - Status[QNum][2]) - 1) / (Status[QNum][1].length - 1); //If less than zero, set to zero if (Status[QNum][3] < 0){Status[QNum][3] = 0;} } } //Check whether the quiz is finished Finished = true; for (var i=0; i' + CurrScore; WriteScore(CurrScore); } if (Finished == true){ var CFT = 0; for (i=0; i 0){ WriteFeedback(Output); } } function CheckAnswer(QNum, ANum){ var Output = I[QNum][1][ANum][1]; if (Output==''){ if (I[QNum][1][ANum][2] == 1){ Output = DefaultRight; } else{ Output = DefaultWrong; } } //If it's not been previously answered correctly if (Status[QNum][0] == 0){ //If it's a correct answer if (I[QNum][1][ANum][2] == 1){ Status[QNum][0] = 1;//Mark the Q as done Status[QNum][1][ANum] = 'R'; MarkAnswer(QNum, ANum, true); //Calculate the score for this question as a floating-point fraction of 1 var PossibleWrongs = 0; for (var i=0; i' + CurrScore; WriteScore(CurrScore); } if (Finished == true){ var CFT = 0; for (i=0; i 0){ WriteFeedback(Output); } } function CalculateScore(){ var TriedQs = 0; var TotalScore = 0; for (var i=0; i 0)||(Status[i][3] == 1)){ TriedQs++; TotalScore += Status[i][3]; } } if (TriedQs == 0){ Score = 0; } else{ Score = (Math.floor(100 * (TotalScore/TriedQs))); } } function MarkAnswer(QNum, ANum, Right, Done){ if (Done == false){ var Mark = CorrectIndicator; if (Right == false){Mark = IncorrectIndicator;} document.getElementById('FB_' + QNum + '_' + ANum).innerHTML = Mark; } else{ if (Right == false){ document.getElementById('FB_' + QNum + '_' + ANum).innerHTML = IncorrectIndicator; } else{ document.getElementById('FB_' + QNum + '_' + ANum).innerHTML = CorrectIndicator; } } } function CheckCheckbox(QNum, ANum){ if (eval('document.QForm.A_' + QNum + '_' + ANum) != null){ eval('document.QForm.A_' + QNum + '_' + ANum).checked = true; } } function ShowReading(){ document.getElementById('ReadingDiv').innerHTML = TempReading; document.getElementById('NextQButton').focus(); // if (is.ns){window.resizeBy(1,0);window.resizeBy(-1,0);;} } //Reading text/timer code var min var sec var ShowReadingAgain = 'Start again...'; function DownTime(mm,ss){ min = mm; sec = ss; if (sec==0) { sec = 60; min--; } sec--; if (sec<10){ sec="0" + sec; } if (document.TimerForm.face == null){ return; } document.TimerForm.face.value= min+":"+sec; if ((min==0) && (sec==0)){ TimesUp() } else{ setTimeout('DownTime(min,sec)',1000) } } function StartReading(){ Stuff='
Remaining time:'; Stuff+='
'; WriteToTimer(Stuff); ShowReading(); timeoutID=setTimeout('DownTime(3,0)',1000); } function TimesUp() { if (ShowReadingAgain.length > 0) { Stuff=''; WriteToTimer(Stuff); } WriteToReading('Your time is over!'); } function WriteToReading(Stuff) { document.getElementById('ReadingDiv').innerHTML = Stuff; document.getElementById('NextQButton').focus(); } function WriteToTimer(Stuff){ document.getElementById('TimerDiv').innerHTML = Stuff; } function SendResults(Score){ var today = new Date; var NewName = '' + today.getTime(); var NewWin = window.open('Submission', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300'); NewWin.document.clear(); NewWin.document.open(); NewWin.document.write(ResultForm); NewWin.document.close(); NewWin.document.Results.Score.value = Score + '%'; NewWin.document.Results.realname.value = UserName; NewWin.document.Results.End_Time.value = (new Date()).toLocaleString(); NewWin.document.Results.Start_Time.value = StartTime; NewWin.document.Results.submit(); } function Finish(){ //If there's a form, fill it out and submit it if (document.store != null){ Frm = document.store; Frm.starttime.value = HPNStartTime; Frm.endtime.value = (new Date()).getTime(); Frm.mark.value = Score; Frm.submit(); } } //--> //]]>
-->
A Student Introduces Himself
ATTENZIONE. E' necessario trovare la risposta esatta di ogni singolo quesito, altrimenti il programma non invierà il risultato al docente. In caso di risposta errata a un quesito, riprovate fino a che trovate quella giusta. Se fate tutto cliccando a caso sulle risposte, il voto inviato al docente sarà conseguentemente molto basso...

CLICCATE QUI SOTTO PER INIZIARE



You have exactly 3 minutes to finish this... Al termine clicca sulla freccia a destra del bottone "Index" in alto.