<'; ReadingText+='/td>'; if (is.CRAPBrowser){ReadingText=ResolveAllURLs(ReadingText);} var NavBar=''; NavBar+='
'; NavBar+=''; NavBar+=''; NavBar+=''; NavBar+=''; NavBar+='
'; var TitleCode = ''; TitleCode += '' + ExerciseTitle + '
'; TitleCode += '' + ExerciseSubtitle + '
'; TitleCode += '
'; macrightchar = ':-)' macwrongchar = 'X' winrightchar = ':-)' winwrongchar = 'X' var QButtonsOpener = ''; QButtonsOpener += '
'; QButtonsOpener += ''; var QButtonsCloser = ''; QButtonsCloser += '
'; var TableOpener = '
'; TableOpener += ''; var QRow = ''; QRow += ''; var ARow = ''; ARow += ''; ARow += ''; var MARow = ''; var CheckButton = '' } OutString += '
'; QRow += '[QNumber][Question]
 '; QRow += '
[Ans]
'; MARow += '[Ans]
0){ history.go((BackSkip+1)*-1); } else{ parent.history.back(); } } 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; i0){ OutString += '
'; OutString += ''; OutString += Feedback; OutString += '
'; //Write it to the frame TopFrame.document.clear(); TopFrame.document.open(); TopFrame.document.write(OutString); TopFrame.document.close(); } function StartUp(){ if ((is.mac)&&(is.ns)){ CorrectIndicator = unescape(macrightchar); IncorrectIndicator = unescape(macwrongchar); } else{ CorrectIndicator = unescape(winrightchar); IncorrectIndicator = unescape(winwrongchar); } //Write the top frame WriteFeedback(Instructions); //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-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
'; } Output = Output + BuildQuestion(I.length-1); Output = TableOpener + Output + TableCloser; DisplayExercise(Output); } function ShowQuestion(QNum){ //First, create the Q number readout at the top var Readout = (QNum+1) + '/' + I.length; while (Readout.length < 7){ Readout = ' ' + Readout + ' '; } Readout = QButtonsOpener + Readout + QButtonsCloser; var Output = BuildQuestion(QNum); Output = TableOpener + Output + TableCloser; DisplayExercise(Readout + Output); //Mark the answers already done for (i=0; i=0; i--){ //Find any incorrect choices var b = eval('BottomFrame.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){ Status[QNum][2]++; Tries++; if (TotWrong == 0){ Status[QNum][0] = 1; CorrectChoices++; } } //Check whether the quiz is finished var Finished = true; for (var i=0; i' + YourScoreIs + ' ' + Score + '%.'; } 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){ Status[QNum][2]++; //increment tries for this Q //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); CorrectChoices++; } else{ Status[QNum][1][ANum] = 'W'; MarkAnswer(QNum, ANum, false); } Tries++; } //Check whether the quiz is finished var Finished = true; for (var i=0; i' + YourScoreIs + ' ' + Score + '%.'; } if (Finished == true){ var CFT = 0; for (i=0; i 0){ WriteFeedback(Output); } } function MarkAnswer(QNum, ANum, Right){ var Mark = CorrectIndicator; if (Right == false){Mark = IncorrectIndicator;} if (eval('BottomFrame.document.QForm.FB_' + QNum + '_' + ANum) != null){ eval('BottomFrame.document.QForm.FB_' + QNum + '_' + ANum).value = Mark; } } function CheckCheckbox(QNum, ANum){ if (eval('BottomFrame.document.QForm.A_' + QNum + '_' + ANum) != null){ eval('BottomFrame.document.QForm.A_' + QNum + '_' + ANum).checked = true; } } function ShowReading(){ if (ReadingFrame != null){ if (ReadingURL.length > 0){ ReadingFrame.location.href=ReadingURL; } else{ ReadingFrame.document.clear(); ReadingFrame.document.open(); ReadingFrame.document.write(ReadingText); ReadingFrame.document.close(); } } } //Reading text/timer code var min var sec var ShowReadingAgain = 'Show reading again'; function DownTime(mm,ss){ min = mm; sec = ss; if (sec==0) { sec = 60; min--; } sec--; if (sec<10){ sec="0" + sec; } if (TimerFrame.document.TimerForm.face == null){ return; } TimerFrame.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=''; Stuff+=''; WriteToTimer(Stuff); } WriteToReading('Your time is over!'); } function WriteToReading(Stuff) { if (is.CRAPBrowser){Stuff=ResolveAllURLs(Stuff);} ReadingFrame.document.clear(); ReadingFrame.document.open(); ReadingFrame.document.writeln (''); ReadingFrame.document.writeln (''); ReadingFrame.document.writeln ('
'); ReadingFrame.document.writeln ('
') ReadingFrame.document.writeln (''); ReadingFrame.document.writeln (Stuff); ReadingFrame.document.writeln ('
'); ReadingFrame.document.close(); } function WriteToTimer(Stuff){ if (is.CRAPBrowser){Stuff=ResolveAllURLs(Stuff);} TimerFrame.document.clear(); TimerFrame.document.open(); TimerFrame.document.writeln (''); TimerFrame.document.writeln (''); TimerFrame.document.writeln ('
'); TimerFrame.document.writeln ('
') TimerFrame.document.writeln (''); TimerFrame.document.writeln (Stuff); TimerFrame.document.writeln ('
'); TimerFrame.document.close(); } function Blank(){ return '©Half-Baked Software. Loading...'; } //--> //]]>