'; OutString += '
'; OutString += NavBar; if (Feedback.length>0){ OutString += '' } 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(){ //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]='Ordina secondo l\'altitudine le seguenti montagne: Pirenei, Alpi, Caucaso, Alpi scandinave.'; I[0][1] = new Array(); I[0][1][0] = new Array(); I[0][1][0][0]='Caucaso Alpi Pirenei Alpi scandinave'; I[1] = new Array(); I[1][0]='Indica tre sistemi montuosi della penisola iberica mettendo ai primi due posti i due sistemi pi\u00F9 giovani quanto ad et\u00E0.'; I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='Sierra Nevada Pirenei Cordigliera Cantabrica'; I[1][1][1] = new Array(); I[1][1][1][0]='Pirenei Sierra Nevada Cordigliera Cantabrica'; I[2] = new Array(); I[2][0]='Indica da ovest ad est le tre grandi pianure europee.'; I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='francese germanica sarmatica'; I[2][1][1] = new Array(); I[2][1][1][0]='francese tedesca sarmatica'; I[2][1][2] = new Array(); I[2][1][2][0]='francese germanica russa'; I[2][1][3] = new Array(); I[2][1][3][0]='francese tedesca russa'; I[3] = new Array(); I[3][0]='Indica due sistemi montuosi dell\'Italia.'; I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='Alpi Appennini'; I[3][1][1] = new Array(); I[3][1][1][0]='Appennini Alpi'; I[4] = new Array(); I[4][0]='Indica il sistena montuoso che d\u00E0 il nome alla penisola pi\u00F9 orientale dell\'Europa mediterranea.'; I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='Balcani'; I[5] = new Array(); I[5][0]='In quale parte della Gran Bretagna ci sono le montagne? ( indica solo il punto cardinale )'; I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='Nord'; I[6] = new Array(); I[6][0]='In quale mare sfocia il Tamigi?'; I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='mare del Nord'; I[6][1][1] = new Array(); I[6][1][1][0]='del Nord'; I[6][1][2] = new Array(); I[6][1][2][0]='Nord'; I[7] = new Array(); I[7][0]='In quale mare si getta la Loira?'; I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='Oceano Atlantico'; I[7][1][1] = new Array(); I[7][1][1][0]='Atlantico'; I[8] = new Array(); I[8][0]='In quale mare sfocia il Rodano?'; I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='mar Mediterraneo'; I[8][1][1] = new Array(); I[8][1][1][0]='Mediterraneo'; I[8][1][2] = new Array(); I[8][1][2][0]='mare Mediterraneo'; I[9] = new Array(); I[9][0]='In quale mare sfocia il Danubio?'; I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='mar Nero'; I[9][1][1] = new Array(); I[9][1][1][0]='Nero'; I[10] = new Array(); I[10][0]='In quale mare sfocia la Vistola?'; I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='mar Baltico'; I[10][1][1] = new Array(); I[10][1][1][0]='Baltico'; I[11] = new Array(); I[11][0]='In quale mare sfocia l\'Ural?'; I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='mar Caspio'; I[11][1][1] = new Array(); I[11][1][1][0]='Caspio'; I[12] = new Array(); I[12][0]='Qual \u00E8 il fiume pi\u00F9 lungo d\'Europa?'; I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='Volga'; I[12][1][1] = new Array(); I[12][1][1][0]='Il Volga'; I[13] = new Array(); I[13][0]='Indica tre fiumi tedeschi da Ovest ad Est.'; I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='Reno Elba Oder'; I[14] = new Array(); I[14][0]='Indica da Ovest ad Est tre fiumi ucraini e/o russi che sfociano nel mar Nero'; I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='Dnester Dnepr Don'; I[15] = new Array(); I[15][0]='Qual \u00E8 il fiume che hai studiato a proposito dei confini d\'Europa?'; I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='Ural'; I[16] = new Array(); I[16][0]='Quali sono i fiumi che hai studiato a proposito dei confini dell\'impero romano?'; I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='Reno Danubio'; I[16][1][1] = new Array(); I[16][1][1][0]='Danubio Reno'; I[17] = new Array(); I[17][0]='Quale fiume hai studiato a proposito del confine orientale dell\'impero di Carlo Magno?'; I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='Elba'; 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 + ' '; //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; 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] + '
'; //Add the current score Output += YourScoreIs + ' ' + CalculateScore() + '%. '; WriteFeedback(Output); return true; } function Blank(){ return '
©Half-Baked Software. Loading...
'; } //--> //]]>
-->