'; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += '
'; var ClozeOpener = '
'; ClozeOpener += '

'; var ClozeCloser = '

'; var Buttons = ''; Buttons += ''; var GapCode = ''; var ClueButton = ''; function WriteFeedback(Feedback){ var Output = Feedback + '

'; document.getElementById('FeedbackContent').innerHTML = Output; var FDiv = document.getElementById('FeedbackDiv'); //Calculate and set its left setting topZ++; FDiv.style.zIndex = topZ; //Position the feedback div pg = new PageDim(); FDiv.style.left = Math.floor(pg.W/3) + 'px'; FDiv.style.width = Math.floor(pg.W/3) + 'px'; //Set the top again in case the window has been resized if (is.ns){ FDiv.style.top = Math.floor(pg.H/3) + window.pageYOffset + 'px'; } else{ FDiv.style.top = Math.floor(pg.H/3) + document.body.scrollTop + 'px'; } FDiv.style.display = 'block'; document.getElementById('FeedbackOKButton').focus(); InGap = false; } function HideFeedback(){ document.getElementById('FeedbackContent').innerHTML = ''; document.getElementById('FeedbackDiv').style.display='none'; if (document.getElementById('GapCode' + CurrentWord) != null){ document.getElementById('GapCode' + CurrentWord).focus(); } else{ FocusAButton(); } if (Finished == true){ Finish(); } } function FocusAButton(){ if (document.getElementById('CheckButton1') != null){ document.getElementById('CheckButton1').focus(); } else{ if (document.getElementById('CheckButton2') != null){ document.getElementById('CheckButton2').focus(); } else{ document.getElementsByTagName('button')[0].focus(); } } } function WriteToInstructions(Feedback) { Feedback = '' + Feedback + ''; document.getElementById('InstructionsDiv').innerHTML = Feedback; } function WriteScore(Feedback) { Feedback = '' + Feedback + ''; document.getElementById('ScoreDiv').innerHTML = Feedback; } I = new Array(); I[0] = new Array(); I[0][1] = new Array(); I[0][1][0] = new Array(); I[0][1][0][0]='his'; I[0][1][1] = new Array(); I[0][1][1][0]='that'; I[0][2]=''; I[1] = new Array(); I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='to'; I[1][2]=''; I[2] = new Array(); I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='which'; I[2][1][1] = new Array(); I[2][1][1][0]='that'; I[2][2]=''; I[3] = new Array(); I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='was'; I[3][2]=''; I[4] = new Array(); I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='not'; I[4][2]=''; I[5] = new Array(); I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='was'; I[5][2]=''; I[6] = new Array(); I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='would'; I[6][2]=''; I[7] = new Array(); I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='at'; I[7][2]=''; I[8] = new Array(); I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='his'; I[8][2]=''; I[9] = new Array(); I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='would'; I[9][2]=''; I[10] = new Array(); I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='would'; I[10][2]=''; I[11] = new Array(); I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='take'; I[11][2]=''; I[12] = new Array(); I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='to'; I[12][2]=''; I[13] = new Array(); I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='was'; I[13][1][1] = new Array(); I[13][1][1][0]='seemed'; I[13][1][2] = new Array(); I[13][1][2][0]='appeared'; I[13][2]=''; I[14] = new Array(); I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='would'; I[14][2]=''; I[15] = new Array(); I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='same'; I[15][2]='identical'; I[16] = new Array(); I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='more'; I[16][1][1] = new Array(); I[16][1][1][0]='rather'; I[16][1][2] = new Array(); I[16][1][2][0]='terribly'; I[16][1][3] = new Array(); I[16][1][3][0]='clearly'; I[16][1][4] = new Array(); I[16][1][4][0]='strongly'; I[16][1][5] = new Array(); I[16][1][5][0]='definitely'; I[16][2]=''; I[17] = new Array(); I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='to'; I[17][2]=''; I[18] = new Array(); I[18][1] = new Array(); I[18][1][0] = new Array(); I[18][1][0][0]='on'; I[18][2]=''; I[19] = new Array(); I[19][1] = new Array(); I[19][1][0] = new Array(); I[19][1][0][0]='was'; I[19][2]=''; I[20] = new Array(); I[20][1] = new Array(); I[20][1][0] = new Array(); I[20][1][0][0]='stopped'; I[20][1][1] = new Array(); I[20][1][1][0]='ceased'; I[20][2]='gave up'; I[21] = new Array(); I[21][1] = new Array(); I[21][1][0] = new Array(); I[21][1][0][0]='over'; I[21][2]=''; I[22] = new Array(); I[22][1] = new Array(); I[22][1][0] = new Array(); I[22][1][0][0]='mself'; I[22][2]=''; Text = new Array(); Text[0]='Sam, a three year old boy not too big for '; Text[1]=' age, was sent '; Text[2]=' our kindergarten during the war. He missed his mother a lot. The situation '; Text[3]=' developed after she left '; Text[4]=' very sad. Sam tried '; Text[5]=' to cry at first, and '; Text[6]=' not seen crying. Instead, he '; Text[7]=' nod his head whenever anyone looked '; Text[8]=' him, and assured us and '; Text[9]=' listener that his mother '; Text[10]=' come for him, she '; Text[11]=' put on his overcoat and '; Text[12]=' him home with her again. Whenever a listener seemed '; Text[13]=' believe him, he '; Text[14]=' satisfied; whenever anybody contradicted him, his self-control left him and he '; Text[15]=' burst into violent tears. The '; Text[16]=' behaviour persisted through the next days with several additions: the nodding took on a '; Text[17]=' compulsive and automatic character and '; Text[18]=' the sentence "My mother will put '; Text[19]=' my overcoat and take me home again" was added an ever-growing list of clothes that his mother '; Text[20]=' supposed to put on him. When the repetitions of this formula became endless, he '; Text[21]=' saying it aloud, but he started saying it '; Text[22]=' and over to hi'; Text[23]='.'; State = new Array(); function StartUp(){ //IE bug avoidance -- remove bottom navbar if (is.ie){ if (document.getElementById('BottomNavBar') != null){ document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar')); } } if (is.ie){ document.attachEvent('onkeydown',SuppressBackspace); window.attachEvent('onkeydown',SuppressBackspace); } else if (is.ns){ window.addEventListener('keypress',SuppressBackspace,false); } //Try to get user name UserName = prompt('Please enter your name and ID number',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ UserName = prompt('Please enter your name and ID number',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ history.back(); } } var i = 0; State.length = 0; for (i=0; i'; } else{ GapLen = I[i][1][0][0].length; if (GapLen < 3){GapLen = 3;} Gap = ReplaceStuff('[strGapSize]', GapLen, GapCode); Gap = ReplaceStuff('[strGapName]', 'Gap' + i + '', Gap); Gap = ReplaceStuff('[strItemNum]', i + '', Gap); Gap = ReplaceStuff('[strValue]', State[i][5], Gap); ClozeStuff += Gap; //Create and add the clue button if (I[i][2].length > 0){ Btn = ReplaceStuff('[strItemNum]', i + '', ClueButton); ClozeStuff += Btn; } } } //Add the last bit if (Text.length > I.length){ ClozeStuff += Text[Text.length-1]; } //Put the final pieces together OutString = ReplaceStuff('[strCheckButtonId]', 'CheckButton1', Buttons) + ClozeOpener + ClozeStuff + ClozeCloser + ReplaceStuff('[strCheckButtonId]', 'CheckButton2', Buttons); BuiltCloze = OutString; } function DisplayExercise(){ document.getElementById('MainDiv').innerHTML = BuiltCloze; } function ShowClue(ItemNum){ //alert(ItemNum); State[ItemNum][0] = 1; WriteFeedback(I[ItemNum][2]); } function SaveCurrentAnswers(){ for (var 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 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 CheckAnswers(){ SaveCurrentAnswers(); var AllCorrect = 1; //Check each answer for (var i = 0; i< I.length; i++){ if (State[i][4] != 1){ //If it's right, calculate its score if (CheckAnswer(i, true) > -1){ var TotalChars = GetGapValue(i).length; State[i][3] = (TotalChars-State[i][1])/TotalChars; if (State[i][0] > 0){State[i][3] = State[i][3]/2;} if (State[i][3]<0){State[i][3] = 0;} State[i][4] = 1; } else{ //Otherwise, add zero to the array and increment the hints for this item, as a penalty State[i][1]++; State[i][3] = 0; //then set the flag AllCorrect = 0; } } } //Calculate the total score var TotalScore = 0; for (i=0; i'; } Output += YourScoreIs + ' ' + TotalScore + '%.
'; if (AllCorrect == 0){ Output += '
' + Incorrect; } BuildExercise(); WriteFeedback(Output); setTimeout('WriteToInstructions(Output)', 50); if (AllCorrect==1){ Score = TotalScore; setTimeout('SendResults(' + TotalScore + ')', 50); setTimeout('DisplayExercise()', 50); Finished = true; setTimeout('Finish()', SubmissionTimeout); return; } setTimeout('DisplayExercise()', 50); RestoreCurrentAnswers(); } var InGap = false; function TrackFocus(BoxNumber){ CurrentWord = BoxNumber; InGap = true; } function LeaveGap(){ InGap = false; } function CheckBeginning(Guess, Answer){ var OutString = ''; var i = 0; var UpperGuess = ''; var UpperAnswer = ''; if (CaseSensitive == false) { UpperGuess = Guess.toUpperCase(); UpperAnswer = Answer.toUpperCase(); } else { UpperGuess = Guess; UpperAnswer = Answer; } while (UpperGuess.charAt(i) == UpperAnswer.charAt(i)) { OutString += Guess.charAt(i); i++; } OutString += Answer.charAt(i); return OutString; } function FindLongest(InArray){ if (InArray.length < 1){return -1;} var Longest = 0; for (var i=1; i InArray[Longest].length){ Longest = i; } } return Longest; } function GetGapValue(GNum){ var RetVal = ''; if ((GNum<0)||(GNum>=I.length)){return RetVal;} if (eval('document.Cloze.Gap' + GNum) != null){ RetVal = eval('document.Cloze.Gap' + GNum).value; RetVal = TrimString(RetVal); } else{ RetVal = State[GNum][5]; } return RetVal; } function SetGapValue(GNum, Val){ if ((GNum<0)||(GNum>=I.length)){return;} if (eval('document.Cloze.Gap' + GNum) != null){ eval('document.Cloze.Gap' + GNum).value = Val; } } function FindCurrent() { var x = 0; FoundCurrent = -1; //Test the current word: //If it's state is not set to already correct, check the word. if (State[CurrentWord][4] != 1){ if (CheckAnswer(CurrentWord, false) < 0){ return CurrentWord; } } x=CurrentWord + 1; while (x -1){return ''} RightBits = new Array(); for (var i=0; i 0){ SetGapValue(CurrGap, HintString); State[CurrGap][1] = State[CurrGap][1] + 1; } WriteFeedback(GiveHint); } function ShowReading(){ document.getElementById('ReadingDiv').innerHTML = TempReading; } //Reading text/timer code var min var sec var ShowReadingAgain = 'Start again'; function DownTime(mm,ss){ min = mm; sec = ss; if (sec==0) { sec = 60; min--; } sec--; if (sec<10){ sec="0" + sec; } if (document.TimerForm.face == null){ return; } 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(5,0)',1000); } function TimesUp() { if (ShowReadingAgain.length > 0) { Stuff=''; WriteToTimer(Stuff); } WriteToReading('Your time is over!'); } function WriteToReading(Stuff) { document.getElementById('ReadingDiv').innerHTML = Stuff; } function WriteToTimer(Stuff){ document.getElementById('TimerDiv').innerHTML = Stuff; FocusAButton(); } function SendResults(Score){ var today = new Date; var NewName = '' + today.getTime(); var NewWin = window.open('Submission', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300'); NewWin.document.clear(); NewWin.document.open(); NewWin.document.write(ResultForm); NewWin.document.close(); NewWin.document.Results.Score.value = Score + '%'; NewWin.document.Results.realname.value = UserName; NewWin.document.Results.End_Time.value = (new Date()).toLocaleString(); NewWin.document.Results.Start_Time.value = StartTime; NewWin.document.Results.submit(); } function Finish(){ //If there's a form, fill it out and submit it if (document.store != null){ Frm = document.store; Frm.starttime.value = HPNStartTime; Frm.endtime.value = (new Date()).getTime(); Frm.mark.value = Score; Frm.submit(); } } //--> //]]>
-->
Compulsive behaviour
ATTENZIONE. E' necessario trovare la risposta esatta di ogni singolo quesito, altrimenti il programma non invierà il risultato al docente. In caso di risposta errata a un quesito, riprovate fino a che trovate quella giusta. Se fate tutto cliccando a caso sulle risposte, il voto inviato al docente sarà conseguentemente molto basso...

Fill in all the gaps, then press "Check" to check your answers. Use the "Hint" button to get a free letter if an answer is giving you trouble. Note that you will lose points if you ask for hints!
Please NOTE: the correction is case-sensitive!

Five-minute exercise