'; 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 parliamo'; I[0][1] = new Array(); I[0][1][0] = new Array(); I[0][1][0][0]='Nous parlons'; I[0][1][1] = new Array(); I[0][1][1][0]='nous parlons'; I[1] = new Array(); I[1][0]='Tu hai studiato'; I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='Tu as \u00E9tudi\u00E9'; I[1][1][1] = new Array(); I[1][1][1][0]='tu as \u00E9tudi\u00E9'; I[2] = new Array(); I[2][0]='Voi leggete'; I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='Vous lisez'; I[2][1][1] = new Array(); I[2][1][1][0]='vous lisez'; I[3] = new Array(); I[3][0]='Egli ha'; I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='Il a'; I[3][1][1] = new Array(); I[3][1][1][0]='il a'; I[4] = new Array(); I[4][0]='Essi vanno'; I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='Ils vont'; I[4][1][1] = new Array(); I[4][1][1][0]='ils vont'; I[5] = new Array(); I[5][0]='Tu non impari'; I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='Tu n\'apprends pas'; I[5][1][1] = new Array(); I[5][1][1][0]='tu n\'apprends pas'; I[6] = new Array(); I[6][0]='Voi avete lavorato'; I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='Vous avez travaill\u00E9'; I[6][1][1] = new Array(); I[6][1][1][0]='vous avez travaill\u00E9'; I[7] = new Array(); I[7][0]='Tu abiti'; I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='Tu habites'; I[7][1][1] = new Array(); I[7][1][1][0]='tu habites'; I[8] = new Array(); I[8][0]='Essi lavorano'; I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='Ils travaillent'; I[8][1][1] = new Array(); I[8][1][1][0]='ils travaillent'; I[9] = new Array(); I[9][0]='Voi fate'; I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='Vous faites'; I[9][1][1] = new Array(); I[9][1][1][0]='vous faites'; I[10] = new Array(); I[10][0]='Essi non hanno studiato'; I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='Ils n\'ont pas \u00E9tudi\u00E9'; I[10][1][1] = new Array(); I[10][1][1][0]='ils n\'ont pas \u00E9tudi\u00E9'; I[11] = new Array(); I[11][0]='Tu hai cantato'; I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='Tu as chant\u00E9'; I[11][1][1] = new Array(); I[11][1][1][0]='tu as chant\u00E9'; I[12] = new Array(); I[12][0]='Voi conoscete'; I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='Vous connaissez'; I[12][1][1] = new Array(); I[12][1][1][0]='vous connaissez'; I[13] = new Array(); I[13][0]='Egli scrive'; I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='Il \u00E9crit'; I[13][1][1] = new Array(); I[13][1][1][0]='il \u00E9crit'; I[14] = new Array(); I[14][0]='Noi abbiamo'; I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='Nous avons'; I[14][1][1] = new Array(); I[14][1][1][0]='nous avons'; I[15] = new Array(); I[15][0]='Noi abbiamo avuto'; I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='Nous avons eu'; I[15][1][1] = new Array(); I[15][1][1][0]='nous avons eu'; I[16] = new Array(); I[16][0]='Essi studiano'; I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='Ils \u00E9tudient'; I[16][1][1] = new Array(); I[16][1][1][0]='ils \u00E9tudient'; I[17] = new Array(); I[17][0]='Tu non hai scritto'; I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='Tu n\'as pas \u00E9crit'; I[17][1][1] = new Array(); I[17][1][1][0]='tu n\'as pas \u00E9crit'; I[18] = new Array(); I[18][0]='Egli fa'; I[18][1] = new Array(); I[18][1][0] = new Array(); I[18][1][0][0]='Il fait'; I[18][1][1] = new Array(); I[18][1][1][0]='il fait'; I[19] = new Array(); I[19][0]='Essi hanno letto'; I[19][1] = new Array(); I[19][1][0] = new Array(); I[19][1][0][0]='Ils ont lu'; I[19][1][1] = new Array(); I[19][1][1][0]='ils ont lu'; I[20] = new Array(); I[20][0]='Noi ci chiamiamo'; I[20][1] = new Array(); I[20][1][0] = new Array(); I[20][1][0][0]='Nous nous appelons'; I[20][1][1] = new Array(); I[20][1][1][0]='nous nous appelons'; I[21] = new Array(); I[21][0]='Voi siete'; I[21][1] = new Array(); I[21][1][0] = new Array(); I[21][1][0][0]='Vous \u00EAtes'; I[21][1][1] = new Array(); I[21][1][1][0]='vous \u00EAtes'; I[22] = new Array(); I[22][0]='Tu leggi'; I[22][1] = new Array(); I[22][1][0] = new Array(); I[22][1][0][0]='Tu lis'; I[22][1][1] = new Array(); I[22][1][1][0]='tu lis'; I[23] = new Array(); I[23][0]='Io vado'; I[23][1] = new Array(); I[23][1][0] = new Array(); I[23][1][0][0]='Je vais'; I[23][1][1] = new Array(); I[23][1][1][0]='je vais'; I[24] = new Array(); I[24][0]='Noi non abbiamo parlato'; I[24][1] = new Array(); I[24][1][0] = new Array(); I[24][1][0][0]='Nous n\'avons pas parl\u00E9'; I[24][1][1] = new Array(); I[24][1][1][0]='nous n\'avons pas parl\u00E9'; I[25] = new Array(); I[25][0]='Egli comprende'; I[25][1] = new Array(); I[25][1][0] = new Array(); I[25][1][0][0]='Il comprend'; I[25][1][1] = new Array(); I[25][1][1][0]='il comprend'; I[26] = new Array(); I[26][0]='Io ho fatto'; I[26][1] = new Array(); I[26][1][0] = new Array(); I[26][1][0][0]='J\'ai fait'; I[26][1][1] = new Array(); I[26][1][1][0]='j\'ai fait'; I[27] = new Array(); I[27][0]='Essi scrivono'; I[27][1] = new Array(); I[27][1][0] = new Array(); I[27][1][0][0]='Ils \u00E9crivent'; I[27][1][1] = new Array(); I[27][1][1][0]='ils \u00E9crivent'; I[28] = new Array(); I[28][0]='Voi avete compreso'; I[28][1] = new Array(); I[28][1][0] = new Array(); I[28][1][0][0]='Vous avez compris'; I[28][1][1] = new Array(); I[28][1][1][0]='vous avez compris'; I[29] = new Array(); I[29][0]='Voi abitate'; I[29][1] = new Array(); I[29][1][0] = new Array(); I[29][1][0][0]='Vous habitez'; I[29][1][1] = new Array(); I[29][1][1][0]='vous habitez'; I[30] = new Array(); I[30][0]='Tu sei stato'; I[30][1] = new Array(); I[30][1][0] = new Array(); I[30][1][0][0]='Tu as \u00E9t\u00E9'; I[30][1][1] = new Array(); I[30][1][1][0]='tu as \u00E9t\u00E9'; I[31] = new Array(); I[31][0]='Essi imparano'; I[31][1] = new Array(); I[31][1][0] = new Array(); I[31][1][0][0]='Ils apprennent'; I[31][1][1] = new Array(); I[31][1][1][0]='ils apprennent'; I[32] = new Array(); I[32][0]='Voi prendete'; I[32][1] = new Array(); I[32][1][0] = new Array(); I[32][1][0][0]='Vous prenez'; I[32][1][1] = new Array(); I[32][1][1][0]='vous prenez'; I[33] = new Array(); I[33][0]='Noi conosciamo'; I[33][1] = new Array(); I[33][1][0] = new Array(); I[33][1][0][0]='Nous connaissons'; I[33][1][1] = new Array(); I[33][1][1][0]='nous connaissons'; I[34] = new Array(); I[34][0]='Egli ha fatto'; I[34][1] = new Array(); I[34][1][0] = new Array(); I[34][1][0][0]='Il a fait'; I[34][1][1] = new Array(); I[34][1][1][0]='il a fait'; I[35] = new Array(); I[35][0]='Tu comprendi'; I[35][1] = new Array(); I[35][1][0] = new Array(); I[35][1][0][0]='Tu comprends'; I[35][1][1] = new Array(); I[35][1][1][0]='tu comprends'; I[36] = new Array(); I[36][0]='Voi avete imparato'; I[36][1] = new Array(); I[36][1][0] = new Array(); I[36][1][0][0]='Vous avez appris'; I[36][1][1] = new Array(); I[36][1][1][0]='vous avez appris'; I[37] = new Array(); I[37][0]='Tu fai'; I[37][1] = new Array(); I[37][1][0] = new Array(); I[37][1][0][0]='Tu fais'; I[37][1][1] = new Array(); I[37][1][1][0]='tu fais'; I[38] = new Array(); I[38][0]='Essi prendono'; I[38][1] = new Array(); I[38][1][0] = new Array(); I[38][1][0][0]='Ils prennent'; I[38][1][1] = new Array(); I[38][1][1][0]='ils prennent'; I[39] = new Array(); I[39][0]='Essi parlano'; I[39][1] = new Array(); I[39][1][0] = new Array(); I[39][1][0][0]='Ils parlent'; I[39][1][1] = new Array(); I[39][1][1][0]='ils parlent'; I[40] = new Array(); I[40][0]='Noi comprendiamo'; I[40][1] = new Array(); I[40][1][0] = new Array(); I[40][1][0][0]='Nous comprenons'; I[40][1][1] = new Array(); I[40][1][1][0]='nous comprenons'; I[41] = new Array(); I[41][0]='Tu non hai fatto'; I[41][1] = new Array(); I[41][1][0] = new Array(); I[41][1][0][0]='Tu n\'as pas fait'; I[41][1][1] = new Array(); I[41][1][1][0]='tu n\'as pas fait'; I[42] = new Array(); I[42][0]='Essi fanno'; I[42][1] = new Array(); I[42][1][0] = new Array(); I[42][1][0][0]='Ils font'; I[42][1][1] = new Array(); I[42][1][1][0]='ils font'; I[43] = new Array(); I[43][0]='Essi non si chiamano'; I[43][1] = new Array(); I[43][1][0] = new Array(); I[43][1][0][0]='Ils ne s\'appellent pas'; I[43][1][1] = new Array(); I[43][1][1][0]='ils ne s\'appellent pas'; I[44] = new Array(); I[44][0]='Noi prendiamo'; I[44][1] = new Array(); I[44][1][0] = new Array(); I[44][1][0][0]='Nous prenons'; I[44][1][1] = new Array(); I[44][1][1][0]='nous prenons'; I[45] = new Array(); I[45][0]='Essi conoscono'; I[45][1] = new Array(); I[45][1][0] = new Array(); I[45][1][0][0]='Ils connaissent'; I[45][1][1] = new Array(); I[45][1][1][0]='ils connaissent'; I[46] = new Array(); I[46][0]='Io sono'; I[46][1] = new Array(); I[46][1][0] = new Array(); I[46][1][0][0]='Je suis'; I[46][1][1] = new Array(); I[46][1][1][0]='je suis'; I[47] = new Array(); I[47][0]='Essi sono'; I[47][1] = new Array(); I[47][1][0] = new Array(); I[47][1][0][0]='Ils sont'; I[47][1][1] = new Array(); I[47][1][1][0]='ils sont'; I[48] = new Array(); I[48][0]='Egli ha cantato'; I[48][1] = new Array(); I[48][1][0] = new Array(); I[48][1][0][0]='Il a chant\u00E9'; I[48][1][1] = new Array(); I[48][1][1][0]='il a chant\u00E9'; I[49] = new Array(); I[49][0]='Voi avete avuto'; I[49][1] = new Array(); I[49][1][0] = new Array(); I[49][1][0][0]='Vous avez eu'; I[49][1][1] = new Array(); I[49][1][1][0]='vous avez eu'; I[50] = new Array(); I[50][0]='Noi abbiamo lavorato'; I[50][1] = new Array(); I[50][1][0] = new Array(); I[50][1][0][0]='Nous avons travaill\u00E9'; I[50][1][1] = new Array(); I[50][1][1][0]='nous avons travaill\u00E9'; I[51] = new Array(); I[51][0]='Voi parlate'; I[51][1] = new Array(); I[51][1][0] = new Array(); I[51][1][0][0]='Vous parlez'; I[51][1][1] = new Array(); I[51][1][1][0]='vous parlez'; I[52] = new Array(); I[52][0]='Tu studi'; I[52][1] = new Array(); I[52][1][0] = new Array(); I[52][1][0][0]='Tu \u00E9tudies'; I[52][1][1] = new Array(); I[52][1][1][0]='tu \u00E9tudies'; I[53] = new Array(); I[53][0]='Essi leggono'; I[53][1] = new Array(); I[53][1][0] = new Array(); I[53][1][0][0]='Ils lisent'; I[53][1][1] = new Array(); I[53][1][1][0]='ils lisent'; I[54] = new Array(); I[54][0]='Voi comprendete'; I[54][1] = new Array(); I[54][1][0] = new Array(); I[54][1][0][0]='Vous comprenez'; I[54][1][1] = new Array(); I[54][1][1][0]='vous comprenez'; I[55] = new Array(); I[55][0]='Tu vai'; I[55][1] = new Array(); I[55][1][0] = new Array(); I[55][1][0][0]='Tu vas'; I[55][1][1] = new Array(); I[55][1][1][0]='tu vas'; I[56] = new Array(); I[56][0]='Essi hanno fatto'; I[56][1] = new Array(); I[56][1][0] = new Array(); I[56][1][0][0]='Ils ont fait'; I[56][1][1] = new Array(); I[56][1][1][0]='ils ont fait'; I[57] = new Array(); I[57][0]='Voi imparate'; I[57][1] = new Array(); I[57][1][0] = new Array(); I[57][1][0][0]='Vous apprenez'; I[57][1][1] = new Array(); I[57][1][1][0]='vous apprenez'; I[58] = new Array(); I[58][0]='Egli abita'; I[58][1] = new Array(); I[58][1][0] = new Array(); I[58][1][0][0]='Il habite'; I[58][1][1] = new Array(); I[58][1][1][0]='il habite'; I[59] = new Array(); I[59][0]='Voi non avete scritto'; I[59][1] = new Array(); I[59][1][0] = new Array(); I[59][1][0][0]='Vous n\'avez pas \u00E9crit'; I[59][1][1] = new Array(); I[59][1][1][0]='vous n\'avez pas \u00E9crit'; I[60] = new Array(); I[60][0]='Tu hai imparato'; I[60][1] = new Array(); I[60][1][0] = new Array(); I[60][1][0][0]='Tu as appris'; I[60][1][1] = new Array(); I[60][1][1][0]='tu as appris'; I[61] = new Array(); I[61][0]='Noi impariamo'; I[61][1] = new Array(); I[61][1][0] = new Array(); I[61][1][0][0]='Nous apprenons'; I[61][1][1] = new Array(); I[61][1][1][0]='nous apprenons'; I[62] = new Array(); I[62][0]='Tu prendi'; I[62][1] = new Array(); I[62][1][0] = new Array(); I[62][1][0][0]='Tu prends'; I[62][1][1] = new Array(); I[62][1][1][0]='tu prends'; I[63] = new Array(); I[63][0]='Voi avete studiato'; I[63][1] = new Array(); I[63][1][0] = new Array(); I[63][1][0][0]='Vous avez \u00E9tudi\u00E9'; I[63][1][1] = new Array(); I[63][1][1][0]='vous avez \u00E9tudi\u00E9'; I[64] = new Array(); I[64][0]='Noi andiamo'; I[64][1] = new Array(); I[64][1][0] = new Array(); I[64][1][0][0]='Nous allons'; I[64][1][1] = new Array(); I[64][1][1][0]='nous allons'; I[65] = new Array(); I[65][0]='Voi avete abitato'; I[65][1] = new Array(); I[65][1][0] = new Array(); I[65][1][0][0]='Vous avez habit\u00E9'; I[65][1][1] = new Array(); I[65][1][1][0]='vous avez habit\u00E9'; I[66] = new Array(); I[66][0]='Io conosco'; I[66][1] = new Array(); I[66][1][0] = new Array(); I[66][1][0][0]='Je connais'; I[66][1][1] = new Array(); I[66][1][1][0]='je connais'; I[67] = new Array(); I[67][0]='Egli ha mangiato'; I[67][1] = new Array(); I[67][1][0] = new Array(); I[67][1][0][0]='Il a mang\u00E9'; I[67][1][1] = new Array(); I[67][1][1][0]='il a mang\u00E9'; I[68] = new Array(); I[68][0]='Noi siamo'; I[68][1] = new Array(); I[68][1][0] = new Array(); I[68][1][0][0]='Nous sommes'; I[68][1][1] = new Array(); I[68][1][1][0]='nous sommes'; I[69] = new Array(); I[69][0]='Voi mangiate'; I[69][1] = new Array(); I[69][1][0] = new Array(); I[69][1][0][0]='Vous mangez'; I[69][1][1] = new Array(); I[69][1][1][0]='vous mangez'; I[70] = new Array(); I[70][0]='Egli ha letto'; I[70][1] = new Array(); I[70][1][0] = new Array(); I[70][1][0][0]='Il a lu'; I[70][1][1] = new Array(); I[70][1][1][0]='il a lu'; I[71] = new Array(); I[71][0]='Noi facciamo'; I[71][1] = new Array(); I[71][1][0] = new Array(); I[71][1][0][0]='Nous faisons'; I[71][1][1] = new Array(); I[71][1][1][0]='nous faisons'; I[72] = new Array(); I[72][0]='Essi non hanno parlato'; I[72][1] = new Array(); I[72][1][0] = new Array(); I[72][1][0][0]='Ils n\'ont pas parl\u00E9'; I[72][1][1] = new Array(); I[72][1][1][0]='ils n\'ont pas parl\u00E9'; I[73] = new Array(); I[73][0]='Tu parli'; I[73][1] = new Array(); I[73][1][0] = new Array(); I[73][1][0][0]='Tu parles'; I[73][1][1] = new Array(); I[73][1][1][0]='tu parles'; I[74] = new Array(); I[74][0]='Egli ha compreso'; I[74][1] = new Array(); I[74][1][0] = new Array(); I[74][1][0][0]='Il a compris'; I[74][1][1] = new Array(); I[74][1][1][0]='il a compris'; I[75] = new Array(); I[75][0]='Noi scriviamo'; I[75][1] = new Array(); I[75][1][0] = new Array(); I[75][1][0][0]='Nous \u00E9crivons'; I[75][1][1] = new Array(); I[75][1][1][0]='nous \u00E9crivons'; I[76] = new Array(); I[76][0]='Noi abitiamo'; I[76][1] = new Array(); I[76][1][0] = new Array(); I[76][1][0][0]='Nous habitons'; I[76][1][1] = new Array(); I[76][1][1][0]='nous habitons'; I[77] = new Array(); I[77][0]='Egli legge'; I[77][1] = new Array(); I[77][1][0] = new Array(); I[77][1][0][0]='Il lit'; I[77][1][1] = new Array(); I[77][1][1][0]='il lit'; I[78] = new Array(); I[78][0]='Voi vi chiamate'; I[78][1] = new Array(); I[78][1][0] = new Array(); I[78][1][0][0]='Vous vous appelez'; I[78][1][1] = new Array(); I[78][1][1][0]='vous vous appelez'; I[79] = new Array(); I[79][0]='Io mi chiamo'; I[79][1] = new Array(); I[79][1][0] = new Array(); I[79][1][0][0]='Je m\'appelle'; I[79][1][1] = new Array(); I[79][1][1][0]='je m\'appelle'; 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... '; } //--> //]]> -->