Make your own free website on Tripod.com
'; 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]='address'; I[0][1] = new Array(); I[0][1][0] = new Array(); I[0][1][0][0]='die Adresse'; I[1] = new Array(); I[1][0]='bed'; I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='das Bett'; I[2] = new Array(); I[2][0]='picture; photo'; I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='das Bild'; I[3] = new Array(); I[3][0]='pencil'; I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='der Bleistift'; I[4] = new Array(); I[4][0]='book'; I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='das Buch'; I[5] = new Array(); I[5][0]='bookcase'; I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='das B\u00FCcherregal'; I[6] = new Array(); I[6][0]='book bag'; I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='die B\u00FCchertasche'; I[7] = new Array(); I[7][0]='CD player'; I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='der CD-Spieler'; I[7][1][1] = new Array(); I[7][1][1][0]='der CD-Player'; I[8] = new Array(); I[8][0]='computer'; I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='der Computer'; I[9] = new Array(); I[9][0]='Tuesday'; I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='der Dienstag'; I[10] = new Array(); I[10][0]='Thursday'; I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='der Donnerstag'; I[11] = new Array(); I[11][0]='color'; I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='die Farbe'; I[12] = new Array(); I[12][0]='window'; I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='das Fenster'; I[13] = new Array(); I[13][0]='television set'; I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='der Fernseher'; I[14] = new Array(); I[14][0]='woman'; I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='die Frau'; I[15] = new Array(); I[15][0]='Friday'; I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='der Freitag'; I[16] = new Array(); I[16][0]='garden'; I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='der Garten'; I[17] = new Array(); I[17][0]='guitar'; I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='die Gitarre'; I[18] = new Array(); I[18][0]='notebook'; I[18][1] = new Array(); I[18][1][0] = new Array(); I[18][1][0][0]='das Heft'; I[19] = new Array(); I[19][0]='home address'; I[19][1] = new Array(); I[19][1][0] = new Array(); I[19][1][0][0]='die Heimatadresse'; I[20] = new Array(); I[20][0]='gentleman'; I[20][1] = new Array(); I[20][1][0] = new Array(); I[20][1][0][0]='der Herr'; I[21] = new Array(); I[21][0]='year'; I[21][1] = new Array(); I[21][1][0] = new Array(); I[21][1][0][0]='das Jahr'; I[22] = new Array(); I[22][0]='boy'; I[22][1] = new Array(); I[22][1][0] = new Array(); I[22][1][0][0]='der Junge'; I[23] = new Array(); I[23][0]='cassete deck'; I[23][1] = new Array(); I[23][1][0] = new Array(); I[23][1][0][0]='das Kassettendeck'; I[24] = new Array(); I[24][0]='child'; I[24][1] = new Array(); I[24][1][0] = new Array(); I[24][1][0][0]='das Kind'; I[25] = new Array(); I[25][0]='ballpoint pen'; I[25][1] = new Array(); I[25][1][0] = new Array(); I[25][1][0][0]='der Kugelschreiber'; I[25][1][1] = new Array(); I[25][1][1][0]='der Kuli'; I[26] = new Array(); I[26][0]='lamp'; I[26][1] = new Array(); I[26][1][0] = new Array(); I[26][1][0][0]='die Lampe'; I[27] = new Array(); I[27][0]='man'; I[27][1] = new Array(); I[27][1][0] = new Array(); I[27][1][0][0]='der Mann'; I[28] = new Array(); I[28][0]='Wednesday'; I[28][1] = new Array(); I[28][1][0] = new Array(); I[28][1][0][0]='der Mittwoch'; I[29] = new Array(); I[29][0]='number'; I[29][1] = new Array(); I[29][1][0] = new Array(); I[29][1][0][0]='die Nummer'; I[30] = new Array(); I[30][0]='paper'; I[30][1] = new Array(); I[30][1][0] = new Array(); I[30][1][0][0]='das Papier'; I[31] = new Array(); I[31][0]='plant'; I[31][1] = new Array(); I[31][1][0] = new Array(); I[31][1][0][0]='die Pflanze'; I[32] = new Array(); I[32][0]='poster'; I[32][1] = new Array(); I[32][1][0] = new Array(); I[32][1][0][0]='das Poster'; I[33] = new Array(); I[33][0]='radio'; I[33][1] = new Array(); I[33][1][0] = new Array(); I[33][1][0][0]='das Radio'; I[34] = new Array(); I[34][0]='backpack'; I[34][1] = new Array(); I[34][1][0] = new Array(); I[34][1][0][0]='der Rucksack'; I[35] = new Array(); I[35][0]='Saturday (S. Germany)'; I[35][1] = new Array(); I[35][1][0] = new Array(); I[35][1][0][0]='der Samstag'; I[36] = new Array(); I[36][0]='school address'; I[36][1] = new Array(); I[36][1][0] = new Array(); I[36][1][0][0]='die Semesteradresse'; I[37] = new Array(); I[37][0]='Saturday (N. Germany)'; I[37][1] = new Array(); I[37][1][0] = new Array(); I[37][1][0][0]='der Sonnabend'; I[38] = new Array(); I[38][0]='Sunday'; I[38][1] = new Array(); I[38][1][0] = new Array(); I[38][1][0][0]='der Sonntag'; I[39] = new Array(); I[39][0]='street'; I[39][1] = new Array(); I[39][1][0] = new Array(); I[39][1][0][0]='die Stra\u00DFe'; I[40] = new Array(); I[40][0]='chair'; I[40][1] = new Array(); I[40][1][0] = new Array(); I[40][1][0][0]='der Stuhl'; I[41] = new Array(); I[41][0]='day'; I[41][1] = new Array(); I[41][1][0] = new Array(); I[41][1][0][0]='der Tag'; I[42] = new Array(); I[42][0]='telephone'; I[42][1] = new Array(); I[42][1][0] = new Array(); I[42][1][0][0]='das Telefon'; I[43] = new Array(); I[43][0]='telephone number'; I[43][1] = new Array(); I[43][1][0] = new Array(); I[43][1][0][0]='die Telefonnummer'; I[44] = new Array(); I[44][0]='table'; I[44][1] = new Array(); I[44][1][0] = new Array(); I[44][1][0][0]='der Tisch'; I[45] = new Array(); I[45][0]='door'; I[45][1] = new Array(); I[45][1][0] = new Array(); I[45][1][0][0]='die T\u00FCr'; I[46] = new Array(); I[46][0]='clock; watch'; I[46][1] = new Array(); I[46][1][0] = new Array(); I[46][1][0][0]='die Uhr'; I[47] = new Array(); I[47][0]='wall'; I[47][1] = new Array(); I[47][1][0] = new Array(); I[47][1][0][0]='die Wand'; I[48] = new Array(); I[48][0]='week'; I[48][1] = new Array(); I[48][1][0] = new Array(); I[48][1][0][0]='die Woche'; I[49] = new Array(); I[49][0]='number, numeral'; I[49][1] = new Array(); I[49][1][0] = new Array(); I[49][1][0][0]='die Zahl'; I[50] = new Array(); I[50][0]='room'; I[50][1] = new Array(); I[50][1][0] = new Array(); I[50][1][0][0]='das Zimmer'; I[51] = new Array(); I[51][0]='blue'; I[51][1] = new Array(); I[51][1][0] = new Array(); I[51][1][0][0]='blau'; I[52] = new Array(); I[52][0]='brown'; I[52][1] = new Array(); I[52][1][0] = new Array(); I[52][1][0][0]='braun'; I[53] = new Array(); I[53][0]='yellow'; I[53][1] = new Array(); I[53][1][0] = new Array(); I[53][1][0][0]='gelb'; I[54] = new Array(); I[54][0]='gray'; I[54][1] = new Array(); I[54][1][0] = new Array(); I[54][1][0][0]='grau'; I[55] = new Array(); I[55][0]='green'; I[55][1] = new Array(); I[55][1][0] = new Array(); I[55][1][0][0]='gr\u00FCn'; I[56] = new Array(); I[56][0]='red'; I[56][1] = new Array(); I[56][1][0] = new Array(); I[56][1][0][0]='rot'; I[57] = new Array(); I[57][0]='black'; I[57][1] = new Array(); I[57][1][0] = new Array(); I[57][1][0][0]='schwarz'; I[58] = new Array(); I[58][0]='white'; I[58][1] = new Array(); I[58][1][0] = new Array(); I[58][1][0][0]='wei\u00DF'; I[59] = new Array(); I[59][0]='girl'; I[59][1] = new Array(); I[59][1][0] = new Array(); I[59][1][0][0]='das M\u00E4dchen'; I[60] = new Array(); I[60][0]='today'; I[60][1] = new Array(); I[60][1][0] = new Array(); I[60][1][0][0]='heute'; 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){ 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 + ' '; if (OtherAnswers.length > 0){ Output += TheseAnswersToo + '
' + OtherAnswers; } //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] + '
'; for (var i=1; i'; } //Check whether the quiz is finished var Finished = true; for (var i=0; i©Half-Baked Software. Loading...'; } //--> //]]>