 Mr Bean\'s Birthday The head waiter came back. "Have you decided, sir?" he asked. "Er, yes. I\u2019ll have this, please", said Mr Bean, pointing at the menu. A waiter came with a bottle of wine. "Would you like to try the house wine, sir?" "Yes," said Mr Bean. He tasted the wine, then said he couldn\u2019t drink any more." "I\u2019m driving," he said. While he was waiting , Mr Bean got a little bored. He started to play a tune on the wine glasses and a plate using his knife. What did he play? Oh yes, it was "Happy Birthday".A few minutes later, the waiter came with the food. Mr Bean looked expectantly. But what was it? It didn\'t even look cooked! He tried some. It was raw. It tasted horrible! He couldn\'t eat this!!! What was he going to do?Mr Bean looked around the restaurant. Nobody was looking at him. He had an idea. He would hide the meat! He ate the middle of the bread roll and filled it with meat. He hid some under a plate. He poured the sugar out of the sugar bowl and put the meat in the sugar bowl, then poured the sugar back on top of the awful meat!
'; if (is.CRAPBrowser){ReadingText=ResolveAllURLs(ReadingText);} var NavBar=''; NavBar+='
'; NavBar+=''; NavBar+=''; NavBar+='
'; if (is.CRAPBrowser){NavBar = ResolveAllURLs(NavBar);} var TitleCode = ''; TitleCode += '' + ExerciseTitle + '
'; TitleCode += '' + ExerciseSubtitle + '
'; TitleCode += '
'; var QButtonsOpener = ''; QButtonsOpener += '
 '; QButtonsOpener += ''; var QButtonsCloser = ''; QButtonsCloser += '
'; var TableOpener = ''; var QRow = ''; QRow += ''; QRow += ''; var ARow = ''; var BtnRow = ''; TableCloser = '
 '; QRow += '[QNumber] [Question] '; QRow += ' '; ARow += '[AnswerBox] '; BtnRow += ''; BtnRow += ''; BtnRow += '
'; var LongAnswer = ''; var ShortAnswer = ''; function GoBack(){ var BackSkip = history.length - PreviousPage; if (BackSkip > 0){ history.go((BackSkip+1)*-1); } else{ parent.history.back(); } } function TrapReturn(ShowHint,QNum){ //if not yet answered correctly, call CheckAnswer if (Status[QNum] < 1){ CheckAnswer(ShowHint,QNum); return; } //otherwise, move on to the next question if showing serially else{ if (ShowOneByOne == true){ setTimeout('ChangeQ(1)', 50); } } } 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 += '' } 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(); if (TimerFrame != null) { Stuff='ANSWER IN A SENTENCE'; I = new Array(); I = new Array(); I='It tasted horrible.'; I = new Array(); I='It tasted disgusting.'; I = new Array(); I='It tasted terrible.'; I = new Array(); I='It tasted awful.'; I = new Array(); I='It was awful.'; I = new Array(); I='It was horrible.'; I = new Array(); I='It was disgusting.'; I = new Array(); I='It was terrible.'; I = new Array(); I='What did Mr Bean do with the steak tartare?
He _______ it.'; I = new Array(); I = new Array(); I='hid'; 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][i].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].length > 0){ Box.value = Status[QNum]; } 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] = 1; Output = CorrectResponse + ' '; //Get the score for this question var HintPenalty = (Status[QNum]*10)/CorrectAs[Right].length; Status[QNum] = Math.floor((10 - Status[QNum]) - HintPenalty); //Check whether the quiz is finished var Finished = true; for (var i=0; i 0){ CorrectBits[i] = RealAs[i].substring(0,CorrectBits[i].length); } CorrectBits[i] = CheckEnd(Guess, CorrectAs[i]); if (CorrectBits[i].length > 0){ CorrectBits[i] = RealAs[i].substring(RealAs[i].length-CorrectBits[i].length,RealAs[i].length); } CorrectBits[i] = CorrectBits[i] + ' ... ' + CorrectBits[i]; CorrectBits[i] = CorrectBits[i] + RealAs[i].charAt(CorrectBits[i].length); if (CorrectBits[i].charAt(CorrectBits[i].length-1) == ' '){ CorrectBits[i] += RealAs[i].charAt(CorrectBits[i].length); } CorrectBits[i] += '...' } var LongestCorrect = FindLongest(CorrectBits); if (CorrectBits[LongestCorrect].length > 5){ Output = ThisMuchIsCorrect + '
' + CorrectBits[LongestCorrect]; } else{ if (ShowHint == false){ Output = IncorrectResponse; } } //Include words found in the answer var FoundWords = CheckWords(Guess, CorrectAs[LongestCorrect]); if (FoundWords.length > 0){ Output += '
' + TheseWordsAppear + FoundWords; } if (ShowHint == true){ Output += '
' + GiveHint + CorrectBits[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] = 1; Status[QNum] = -1; Status[QNum] = -1; //Get the correct answers and put them into a string var Output = TheseCorrect + '
'; Output += I[QNum] + '
'; //Add the current score Output += YourScoreIs + ' ' + CalculateScore() + '%. '; WriteFeedback(Output); return 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(1,0)',1000); } function TimesUp() { var Stuff=''; if (ShowReadingAgain.length > 0) { 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...'; } //--> //]]>