Hello all,
I have a multiple choice quiz that works fairly well. However, instead of it presenting "End of Quiz" message when last question is completed I need it to take the user back to the beginning (question 1) but with no indication to the user that this has been done.
How can I adjust the code to have it do this? (thanking you in anticipation)
Code:<script language="JavaScript1.1"> var whichone=1 var tempmn=document.quiz.thequestion function generatequestions(){ document.quiz.theresponse.selectedIndex=0 if (!document.quiz.cmode.checked||whichone>=total+1||whichone<=0) document.quiz.thesolution.value='' if (whichone>=total+1) tempmn.value="End of quiz" else{ tempmn.value=whichone+")"+question[whichone]+"\n\n"+"a)"+eval('choice'+whichone+'[1]')+"\n"+"b)"+eval('c hoice'+whichone+'[2]')+"\n"+"c)"+eval('choice'+whichone+'[3]')+"\n"+"d)"+eval('choice'+whichone+'[4]') if (document.quiz.cmode.checked) document.quiz.thesolution.value=solution[whichone] } } function responses(){ var temp2=document.quiz.theresponse var temp3=temp2.options[temp2.selectedIndex].text if (temp3!=solution[whichone]&&temp2.selectedIndex!=0) document.quiz.thesolution.value="Sorry, the correct answer is "+solution[whichone] else if(temp2.selectedIndex!=0) document.quiz.thesolution.value=compliments[Math.round(Math.random()*compliments.length-1)] } generatequestions() </script>


Reply With Quote

Bookmarks