'; OutString += '
'; OutString += NavBar; if (Feedback.length>0){ OutString += '' } OutString += '
'; OutString += ''; OutString += Feedback; OutString += '
'; if (is.CRAPBrowser){OutString=ResolveAllURLs(OutString);} //Write it to the frame TopFrame.document.clear(); TopFrame.document.open(); TopFrame.document.write(OutString); TopFrame.document.close(); } function StartUp(){ //Write the top frame WriteFeedback(Instructions); if ((is.mac)&&(is.ns)) { FocusBoxes = false; } //Reduce array if required if (QsToShow < I.length){ ReduceItems(); } //Shuffle stuff if required if (ShuffleQs == true){ I = Shuffle(I); } //Create arrays CreateStatusArrays(); //Show the first question or all of them if (ShowOneByOne == false){ ShowAllQs(); } else{ ShowQuestion(CurrQNum); } //Focus the first box var Box = eval('BottomFrame.document.QForm0.Guess'); if (Box != null){ Box.focus(); } } I = new Array(); I[0] = new Array(); I[0][0]='Noi potevamo'; I[0][1] = new Array(); I[0][1][0] = new Array(); I[0][1][0][0]='Nous pouvions'; I[0][1][1] = new Array(); I[0][1][1][0]='nous pouvions'; I[1] = new Array(); I[1][0]='Voi dovevate'; I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='Vous deviez'; I[1][1][1] = new Array(); I[1][1][1][0]='vous deviez'; I[2] = new Array(); I[2][0]='Voi dicevate'; I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='Vous disiez'; I[2][1][1] = new Array(); I[2][1][1][0]='vous disiez'; I[3] = new Array(); I[3][0]='Pioveva'; I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='Il pleuvait'; I[3][1][1] = new Array(); I[3][1][1][0]='il pleuvait'; I[4] = new Array(); I[4][0]='Io ero'; I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='J\'\u00E9tais'; I[4][1][1] = new Array(); I[4][1][1][0]='j\'\u00E9tais'; I[5] = new Array(); I[5][0]='Noi uscivamo'; I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='Nous sortions'; I[5][1][1] = new Array(); I[5][1][1][0]='nous sortions'; I[6] = new Array(); I[6][0]='Egli veniva'; I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='Il venait'; I[6][1][1] = new Array(); I[6][1][1][0]='il venait'; I[7] = new Array(); I[7][0]='Essi seguivano'; I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='Ils suivaient'; I[7][1][1] = new Array(); I[7][1][1][0]='ils suivaient'; I[8] = new Array(); I[8][0]='Essi volevano'; I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='Ils voulaient'; I[8][1][1] = new Array(); I[8][1][1][0]='ils voulaient'; I[9] = new Array(); I[9][0]='C\'era'; I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='Il y avait'; I[9][1][1] = new Array(); I[9][1][1][0]='il y avait'; I[10] = new Array(); I[10][0]='Tu scrivevi'; I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='Tu \u00E9crivais'; I[10][1][1] = new Array(); I[10][1][1][0]='tu \u00E9crivais'; I[11] = new Array(); I[11][0]='Noi andavamo'; I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='nous allions'; I[11][1][1] = new Array(); I[11][1][1][0]='Nous allions'; I[12] = new Array(); I[12][0]='Bisognava'; I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='Il fallait'; I[12][1][1] = new Array(); I[12][1][1][0]='il fallait'; I[13] = new Array(); I[13][0]='Tu potevi'; I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='Tu pouvais'; I[13][1][1] = new Array(); I[13][1][1][0]='tu pouvais'; I[14] = new Array(); I[14][0]='Essi avevano'; I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='Ils avaient'; I[14][1][1] = new Array(); I[14][1][1][0]='ils avaient'; I[15] = new Array(); I[15][0]='Voi offrivate'; I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='Vous offriez'; I[15][1][1] = new Array(); I[15][1][1][0]='vous offriez'; I[16] = new Array(); I[16][0]='Tu vedevi'; I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='Tu voyais'; I[16][1][1] = new Array(); I[16][1][1][0]='tu voyais'; I[17] = new Array(); I[17][0]='Noi sceglievamo'; I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='Nous choisissions'; I[17][1][1] = new Array(); I[17][1][1][0]='nous choisissions'; I[18] = new Array(); I[18][0]='Voi chiamavate'; I[18][1] = new Array(); I[18][1][0] = new Array(); I[18][1][0][0]='Vous appeliez'; I[18][1][1] = new Array(); I[18][1][1][0]=''; I[18][1][2] = new Array(); I[18][1][2][0]='vous appeliez'; I[19] = new Array(); I[19][0]='Egli sapeva'; I[19][1] = new Array(); I[19][1][0] = new Array(); I[19][1][0][0]='Il savait'; I[19][1][1] = new Array(); I[19][1][1][0]='il savait'; I[20] = new Array(); I[20][0]='Tu prendevi'; I[20][1] = new Array(); I[20][1][0] = new Array(); I[20][1][0][0]='Tu prenais'; I[20][1][1] = new Array(); I[20][1][1][0]='tu prenais'; I[21] = new Array(); I[21][0]='Egli dormiva'; I[21][1] = new Array(); I[21][1][0] = new Array(); I[21][1][0][0]='Il dormait'; I[21][1][1] = new Array(); I[21][1][1][0]='il dormait'; I[22] = new Array(); I[22][0]='Voi eravate'; I[22][1] = new Array(); I[22][1][0] = new Array(); I[22][1][0][0]='Vous \u00E9tiez'; I[22][1][1] = new Array(); I[22][1][1][0]='vous \u00E9tiez'; I[23] = new Array(); I[23][0]='Tu sceglievi'; I[23][1] = new Array(); I[23][1][0] = new Array(); I[23][1][0][0]='Tu choisissais'; I[23][1][1] = new Array(); I[23][1][1][0]='tu choisissais'; I[24] = new Array(); I[24][0]='Tu leggevi'; I[24][1] = new Array(); I[24][1][0] = new Array(); I[24][1][0][0]='Tu lisais'; I[24][1][1] = new Array(); I[24][1][1][0]='tu lisais'; I[25] = new Array(); I[25][0]='Voi sceglievate'; I[25][1] = new Array(); I[25][1][0] = new Array(); I[25][1][0][0]='Vous choisissiez'; I[25][1][1] = new Array(); I[25][1][1][0]='vous choisissiez'; I[26] = new Array(); I[26][0]='Voi seguivate'; I[26][1] = new Array(); I[26][1][0] = new Array(); I[26][1][0][0]='Vous suiviez'; I[26][1][1] = new Array(); I[26][1][1][0]='vous suiviez'; I[27] = new Array(); I[27][0]='Voi dicevate'; I[27][1] = new Array(); I[27][1][0] = new Array(); I[27][1][0][0]='Vous disiez'; I[27][1][1] = new Array(); I[27][1][1][0]='vous disiez'; I[28] = new Array(); I[28][0]='Noi sapevamo'; I[28][1] = new Array(); I[28][1][0] = new Array(); I[28][1][0][0]='Nous savions'; I[28][1][1] = new Array(); I[28][1][1][0]='nous savions'; I[29] = new Array(); I[29][0]='Voi scrivevate'; I[29][1] = new Array(); I[29][1][0] = new Array(); I[29][1][0][0]='Vous \u00E9criviez'; I[29][1][1] = new Array(); I[29][1][1][0]='vous \u00E9criviez'; I[30] = new Array(); I[30][0]='Essi vedevano'; I[30][1] = new Array(); I[30][1][0] = new Array(); I[30][1][0][0]='Ils voyaient'; I[30][1][1] = new Array(); I[30][1][1][0]='ils voyaient'; I[31] = new Array(); I[31][0]='Tu finivi'; I[31][1] = new Array(); I[31][1][0] = new Array(); I[31][1][0][0]='Tu finissais'; I[31][1][1] = new Array(); I[31][1][1][0]='tu finissais'; I[32] = new Array(); I[32][0]='Essi dovevano'; I[32][1] = new Array(); I[32][1][0] = new Array(); I[32][1][0][0]='Ils devaient'; I[32][1][1] = new Array(); I[32][1][1][0]='ils devaient'; I[33] = new Array(); I[33][0]='Egli camminava'; I[33][1] = new Array(); I[33][1][0] = new Array(); I[33][1][0][0]='Il marchait'; I[33][1][1] = new Array(); I[33][1][1][0]='il marchait'; I[34] = new Array(); I[34][0]='Io volevo'; I[34][1] = new Array(); I[34][1][0] = new Array(); I[34][1][0][0]='Je voulais'; I[34][1][1] = new Array(); I[34][1][1][0]='je voulais'; I[35] = new Array(); I[35][0]='Egli offriva'; I[35][1] = new Array(); I[35][1][0] = new Array(); I[35][1][0][0]='Il offrait'; I[35][1][1] = new Array(); I[35][1][1][0]='il offrait'; I[36] = new Array(); I[36][0]='Voi facevate'; I[36][1] = new Array(); I[36][1][0] = new Array(); I[36][1][0][0]='Vous faisiez'; I[36][1][1] = new Array(); I[36][1][1][0]='vous faisiez'; I[37] = new Array(); I[37][0]='Essi venivano'; I[37][1] = new Array(); I[37][1][0] = new Array(); I[37][1][0][0]='Ils venaient'; I[37][1][1] = new Array(); I[37][1][1][0]='ils venaient'; I[38] = new Array(); I[38][0]='Egli diceva'; I[38][1] = new Array(); I[38][1][0] = new Array(); I[38][1][0][0]='Il disait'; I[38][1][1] = new Array(); I[38][1][1][0]='il disait'; I[39] = new Array(); I[39][0]='Tu abitavi'; I[39][1] = new Array(); I[39][1][0] = new Array(); I[39][1][0][0]='Tu habitais'; I[39][1][1] = new Array(); I[39][1][1][0]='tu habitais'; I[40] = new Array(); I[40][0]='Essi scrivevano'; I[40][1] = new Array(); I[40][1][0] = new Array(); I[40][1][0][0]='Ils \u00E9crivaient'; I[40][1][1] = new Array(); I[40][1][1][0]='ils \u00E9crivaient'; I[41] = new Array(); I[41][0]='Essi sapevano'; I[41][1] = new Array(); I[41][1][0] = new Array(); I[41][1][0][0]='Ils savaient'; I[41][1][1] = new Array(); I[41][1][1][0]='ils savaient'; I[42] = new Array(); I[42][0]='Voi prendevate'; I[42][1] = new Array(); I[42][1][0] = new Array(); I[42][1][0][0]='Vous preniez'; I[42][1][1] = new Array(); I[42][1][1][0]='vous preniez'; I[43] = new Array(); I[43][0]='Tu vedevi'; I[43][1] = new Array(); I[43][1][0] = new Array(); I[43][1][0][0]='Tu voyais'; I[43][1][1] = new Array(); I[43][1][1][0]='tu voyais'; I[44] = new Array(); I[44][0]='Noi seguivamo'; I[44][1] = new Array(); I[44][1][0] = new Array(); I[44][1][0][0]='Nous suivions'; I[44][1][1] = new Array(); I[44][1][1][0]='nous suivions'; I[45] = new Array(); I[45][0]='Essi potevano'; I[45][1] = new Array(); I[45][1][0] = new Array(); I[45][1][0][0]='Ils pouvaient'; I[45][1][1] = new Array(); I[45][1][1][0]='ils pouvaient'; I[46] = new Array(); I[46][0]='Noi parlavamo'; I[46][1] = new Array(); I[46][1][0] = new Array(); I[46][1][0][0]='Nous parlions'; I[46][1][1] = new Array(); I[46][1][1][0]='nous parlions'; I[47] = new Array(); I[47][0]='Essi sceglievano'; I[47][1] = new Array(); I[47][1][0] = new Array(); I[47][1][0][0]='Ils choisissaient'; I[47][1][1] = new Array(); I[47][1][1][0]='ils choisissaient'; I[48] = new Array(); I[48][0]='Tu scrivevi'; I[48][1] = new Array(); I[48][1][0] = new Array(); I[48][1][0][0]='Tu \u00E9crivais'; I[48][1][1] = new Array(); I[48][1][1][0]='tu \u00E9crivais'; I[49] = new Array(); I[49][0]='Egli abitava'; I[49][1] = new Array(); I[49][1][0] = new Array(); I[49][1][0][0]='Il habitait'; I[49][1][1] = new Array(); I[49][1][1][0]='il habitait'; I[50] = new Array(); I[50][0]='Voi seguivate'; I[50][1] = new Array(); I[50][1][0] = new Array(); I[50][1][0][0]='Vous suiviez'; I[50][1][1] = new Array(); I[50][1][1][0]='vous suiviez'; I[51] = new Array(); I[51][0]='Egli andava'; I[51][1] = new Array(); I[51][1][0] = new Array(); I[51][1][0][0]='Il allait'; I[51][1][1] = new Array(); I[51][1][1][0]='il allait'; I[52] = new Array(); I[52][0]='Voi eravate'; I[52][1] = new Array(); I[52][1][0] = new Array(); I[52][1][0][0]='Vous \u00E9tiez'; I[52][1][1] = new Array(); I[52][1][1][0]='vous \u00E9tiez'; I[53] = new Array(); I[53][0]='Tu dovevi'; I[53][1] = new Array(); I[53][1][0] = new Array(); I[53][1][0][0]='Tu devais'; I[53][1][1] = new Array(); I[53][1][1][0]='tu devais'; I[54] = new Array(); I[54][0]='Io leggevo'; I[54][1] = new Array(); I[54][1][0] = new Array(); I[54][1][0][0]='Je lisais'; I[54][1][1] = new Array(); I[54][1][1][0]='je lisais'; I[55] = new Array(); I[55][0]='Tu dicevi'; I[55][1] = new Array(); I[55][1][0] = new Array(); I[55][1][0][0]='Tu disais'; I[55][1][1] = new Array(); I[55][1][1][0]='tu disais'; I[56] = new Array(); I[56][0]='Essi scrivevano'; I[56][1] = new Array(); I[56][1][0] = new Array(); I[56][1][0][0]='lls \u00E9crivaient'; I[56][1][1] = new Array(); I[56][1][1][0]='ils \u00E9crivaient'; I[57] = new Array(); I[57][0]='Voi leggevate'; I[57][1] = new Array(); I[57][1][0] = new Array(); I[57][1][0][0]='Vous lisiez'; I[57][1][1] = new Array(); I[57][1][1][0]='vous lisiez'; I[58] = new Array(); I[58][0]='Io facevo'; I[58][1] = new Array(); I[58][1][0] = new Array(); I[58][1][0][0]='Je faisais'; I[58][1][1] = new Array(); I[58][1][1][0]='je faisais'; I[59] = new Array(); I[59][0]='Voi avevate'; I[59][1] = new Array(); I[59][1][0] = new Array(); I[59][1][0][0]='Vous aviez'; I[59][1][1] = new Array(); I[59][1][1][0]='vous aviez'; I[60] = new Array(); I[60][0]='Egli diceva'; I[60][1] = new Array(); I[60][1][0] = new Array(); I[60][1][0][0]='Il disait'; I[60][1][1] = new Array(); I[60][1][1][0]='il disait'; I[61] = new Array(); I[61][0]='Essi uscivano'; I[61][1] = new Array(); I[61][1][0] = new Array(); I[61][1][0][0]='Ils sortaient'; I[61][1][1] = new Array(); I[61][1][1][0]='ils sortaient'; I[62] = new Array(); I[62][0]='Noi venivamo'; I[62][1] = new Array(); I[62][1][0] = new Array(); I[62][1][0][0]='Nous venions'; I[62][1][1] = new Array(); I[62][1][1][0]='nous venions'; I[63] = new Array(); I[63][0]='Egli finiva'; I[63][1] = new Array(); I[63][1][0] = new Array(); I[63][1][0][0]='Il finissait'; I[63][1][1] = new Array(); I[63][1][1][0]='il finissait'; I[64] = new Array(); I[64][0]='Voi vedevate'; I[64][1] = new Array(); I[64][1][0] = new Array(); I[64][1][0][0]='Vous voyiez'; I[64][1][1] = new Array(); I[64][1][1][0]='vous voyiez'; I[65] = new Array(); I[65][0]='Egli poteva'; I[65][1] = new Array(); I[65][1][0] = new Array(); I[65][1][0][0]='Il pouvait'; I[65][1][1] = new Array(); I[65][1][1][0]='il pouvait'; I[66] = new Array(); I[66][0]='Voi finivate'; I[66][1] = new Array(); I[66][1][0] = new Array(); I[66][1][0][0]='Vous finissiez'; I[66][1][1] = new Array(); I[66][1][1][0]='vous finissiez'; I[67] = new Array(); I[67][0]='Era necessario'; I[67][1] = new Array(); I[67][1][0] = new Array(); I[67][1][0][0]='Il fallait'; I[67][1][1] = new Array(); I[67][1][1][0]='il fallait'; I[68] = new Array(); I[68][0]='Pioveva'; I[68][1] = new Array(); I[68][1][0] = new Array(); I[68][1][0][0]='Il pleuvait'; I[68][1][1] = new Array(); I[68][1][1][0]='il pleuvait'; I[69] = new Array(); I[69][0]='Voi scrivevate'; I[69][1] = new Array(); I[69][1][0] = new Array(); I[69][1][0][0]='Vous \u00E9criviez'; I[69][1][1] = new Array(); I[69][1][1][0]='vous \u00E9criviez'; I[70] = new Array(); I[70][0]='C\'erano'; I[70][1] = new Array(); I[70][1][0] = new Array(); I[70][1][0][0]='Il y avait'; I[70][1][1] = new Array(); I[70][1][1][0]='il y avait'; I[71] = new Array(); I[71][0]='Noi sapevamo'; I[71][1] = new Array(); I[71][1][0] = new Array(); I[71][1][0][0]='Nous savions'; I[71][1][1] = new Array(); I[71][1][1][0]='nous savions'; I[72] = new Array(); I[72][0]='Tu abitavi'; I[72][1] = new Array(); I[72][1][0] = new Array(); I[72][1][0][0]='tu habitais'; I[72][1][1] = new Array(); I[72][1][1][0]='Tu habitais'; I[73] = new Array(); I[73][0]='Tu uscivi'; I[73][1] = new Array(); I[73][1][0] = new Array(); I[73][1][0][0]='Tu sortais'; I[73][1][1] = new Array(); I[73][1][1][0]='tu sortais'; I[74] = new Array(); I[74][0]='Egli diceva'; I[74][1] = new Array(); I[74][1][0] = new Array(); I[74][1][0][0]='Il disait'; I[74][1][1] = new Array(); I[74][1][1][0]='il disait'; I[75] = new Array(); I[75][0]='Essi erano'; I[75][1] = new Array(); I[75][1][0] = new Array(); I[75][1][0][0]='Ils \u00E9taient'; I[75][1][1] = new Array(); I[75][1][1][0]='ils \u00E9taient'; I[76] = new Array(); I[76][0]='Tu volevi'; I[76][1] = new Array(); I[76][1][0] = new Array(); I[76][1][0][0]='Tu voulais'; I[76][1][1] = new Array(); I[76][1][1][0]='tu voulais'; I[77] = new Array(); I[77][0]='Essi prendevano'; I[77][1] = new Array(); I[77][1][0] = new Array(); I[77][1][0][0]='Ils prenaient'; I[77][1][1] = new Array(); I[77][1][1][0]='ils prenaient'; I[78] = new Array(); I[78][0]='Voi dovevate'; I[78][1] = new Array(); I[78][1][0] = new Array(); I[78][1][0][0]='Vous deviez'; I[78][1][1] = new Array(); I[78][1][1][0]='vous deviez'; I[79] = new Array(); I[79][0]='Voi uscivate'; I[79][1] = new Array(); I[79][1][0] = new Array(); I[79][1][0][0]='Vous sortiez'; I[79][1][1] = new Array(); I[79][1][1][0]='vous sortiez'; Status = new Array(); function CreateStatusArrays(){ Status.length = 0; for (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){ // if (Status[CurrQNum][0] < 1) {return;} var NewNum = CurrQNum + ChangeBy; if ((NewNum >= 0)&&(NewNum Longest){ Longest = I[QNum][1][i][0].length; } } var AnsBox = ''; if (Longest > 20){ AnsBox = LongAnswer; } else{ AnsBox = ReplaceStuff('[AnswerSize]', (Longest + ''), ShortAnswer); } var AnsRow = ReplaceStuff('[AnswerBox]', AnsBox, ARow); Temp += AnsRow; Temp += BtnRow; Temp = ReplaceStuff('[QNumber]', QNum+1, Temp); Temp = ReplaceStuff('[QNum]', QNum, Temp); return Temp; } function DisplayExercise(StuffToDisplay){ //Build the output string var OutString = ''; OutString += ''; OutString += ' '; OutString += '
'; OutString += TitleCode; OutString += ''; OutString += NavBar; OutString += '
'; OutString += ''; OutString += StuffToDisplay; OutString += '
'; if (is.CRAPBrowser){OutString=ResolveAllURLs(OutString);} //Write it to the frame BottomFrame.document.clear(); BottomFrame.document.open(); BottomFrame.document.write(OutString); BottomFrame.document.close(); } function ShowAllQs(){ var Output = ''; for (var i=0; i
'; } 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); //Replace the student's answer var Box = eval('BottomFrame.document.QForm' + QNum + '.Guess'); if (Box != null){ if (Status[QNum][3].length > 0){ Box.value = Status[QNum][3]; } Box.focus(); } } function TrimString(InString){ var x = 0 if (InString.length != 0) { while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){ InString = InString.substring(0, InString.length - 1) } while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){ InString = InString.substring(1, InString.length) } while (InString.indexOf(' ') != -1) { x = InString.indexOf(' ') InString = InString.substring(0, x) + InString.substring(x+1, InString.length) } return InString; } else { return ''; } } function RemovePunctuation(InString){ var OutString = ''; for (i=0; i InArray[Longest].length){ Longest = i; } } return Longest; } function CheckWords(Guess, Answer){ var Start = 0; var End = 0; var LoopCounter = 0; var ReturnList = ''; var i = 0; var j = 0; GuessWords = new Array(); AnswerWords = new Array(); Guess = RemovePunctuation(Guess); Answer = RemovePunctuation(Answer); while (Guess.indexOf(' ', Start) > -1) { End = Guess.indexOf(' ', Start); GuessWords[LoopCounter] = Guess.substring(Start, End).toLowerCase(); LoopCounter++; Start = End + 1; } GuessWords[LoopCounter] = Guess.substring(Start, Guess.length).toLowerCase(); Start = 0; LoopCounter = 0; while (Answer.indexOf(' ', Start) > -1) { End = Answer.indexOf(' ', Start); AnswerWords[LoopCounter] = Answer.substring(Start, End); LoopCounter++; Start = End + 1; } AnswerWords[LoopCounter] = Answer.substring(Start, Answer.length); ReturnList = ''; for (i = 0; i < GuessWords.length; i++){ for (j = 0; j < AnswerWords.length; j++){ if (GuessWords[i] == AnswerWords[j].toLowerCase()){ ReturnList = ReturnList + AnswerWords[j] + ', ' ; AnswerWords[j] = ''; break; } } } if (ReturnList.length > 0){ ReturnList = ReturnList.substring(0, ReturnList.length - 2); } return ReturnList; } function CalculateScore(){ Score = 0; var DoneQs = 0; for (i=0; i';}; } if (Right > -1){ Status[QNum][0] = 1; Output = CorrectResponse + ' '; //Get the score for this question var HintPenalty = (Status[QNum][2]*10)/CorrectAs[Right].length; Status[QNum][4] = Math.floor((10 - Status[QNum][1]) - HintPenalty); //Check whether the quiz is finished var Finished = true; for (var i=0; i 0){ CorrectBits[0][i] = RealAs[i].substring(0,CorrectBits[0][i].length); } CorrectBits[1][i] = CheckEnd(Guess, CorrectAs[i]); if (CorrectBits[1][i].length > 0){ CorrectBits[1][i] = RealAs[i].substring(RealAs[i].length-CorrectBits[1][i].length,RealAs[i].length); } CorrectBits[2][i] = CorrectBits[0][i] + ' ... ' + CorrectBits[1][i]; CorrectBits[3][i] = CorrectBits[0][i] + RealAs[i].charAt(CorrectBits[0][i].length); if (CorrectBits[3][i].charAt(CorrectBits[3][i].length-1) == ' '){ CorrectBits[3][i] += RealAs[i].charAt(CorrectBits[3][i].length); } CorrectBits[3][i] += '...' } var LongestCorrect = FindLongest(CorrectBits[2]); if (CorrectBits[2][LongestCorrect].length > 5){ Output = ThisMuchIsCorrect + '
' + CorrectBits[2][LongestCorrect]; } else{ if (ShowHint == false){ Output = IncorrectResponse; } } //Include words found in the answer var FoundWords = CheckWords(Guess, CorrectAs[LongestCorrect]); if (ShowHint == true){ Output += '
' + GiveHint + CorrectBits[3][LongestCorrect]; } WriteFeedback(Output); //Put the focus back in the box if (FocusBoxes==true){ eval('BottomFrame.document.QForm' + (QNum) + '.Guess').focus(); } } } function ShowAnswers(QNum){ //If the question isn't done, mark it as done. Score will be 0; if (Status[QNum][0] != 1){ //Question is not already done Status[QNum][0] = 1; Status[QNum][1] = -1; Status[QNum][2] = -1; } //Get the correct answers and put them into a string var Output = TheseCorrect + '
'; Output += I[QNum][1][0][0] + '
'; //Check whether the quiz is finished var Finished = true; for (var i=0; i ©Half-Baked Software. Loading... '; } //--> //]]> -->