'; 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 DisplayExercise(){ //Build the output string var OutString = ''; OutString += ''; OutString += ''; OutString += '
'; OutString += TitleCode; OutString += ''; OutString += NavBar; OutString += '
'; if (WordBox.length > 0){ OutString += WordBox; } OutString += ''; OutString += BuiltCloze; 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 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; } I = new Array(); I[0] = new Array(); I[0][1] = new Array(); I[0][1][0] = new Array(); I[0][1][0][0]='in'; I[0][2]=''; I[1] = new Array(); I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='was'; I[1][2]=''; I[2] = new Array(); I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='then'; I[2][2]=''; I[3] = new Array(); I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='with'; I[3][2]=''; I[4] = new Array(); I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='one'; I[4][2]=''; I[5] = new Array(); I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='went'; I[5][2]=''; I[6] = new Array(); I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='me'; I[6][2]=''; I[7] = new Array(); I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='with'; I[7][2]=''; I[8] = new Array(); I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='rang'; I[8][2]=''; I[9] = new Array(); I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='said'; I[9][2]=''; I[10] = new Array(); I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='afraid'; I[10][2]=''; I[11] = new Array(); I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='heard'; I[11][2]=''; I[12] = new Array(); I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='went'; I[12][2]=''; I[13] = new Array(); I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='rang'; I[13][2]=''; I[14] = new Array(); I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='heard'; I[14][2]=''; I[15] = new Array(); I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='said'; I[15][2]=''; I[16] = new Array(); I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='heard'; I[16][2]=''; I[17] = new Array(); I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='by'; I[17][2]=''; I[18] = new Array(); I[18][1] = new Array(); I[18][1][0] = new Array(); I[18][1][0][0]='covered'; I[18][2]=''; I[19] = new Array(); I[19][1] = new Array(); I[19][1][0] = new Array(); I[19][1][0][0]='blanket'; I[19][2]=''; I[20] = new Array(); I[20][1] = new Array(); I[20][1][0] = new Array(); I[20][1][0][0]='heard'; I[20][2]=''; I[21] = new Array(); I[21][1] = new Array(); I[21][1][0] = new Array(); I[21][1][0][0]='not'; I[21][2]=''; I[22] = new Array(); I[22][1] = new Array(); I[22][1][0] = new Array(); I[22][1][0][0]='stopped'; I[22][2]=''; I[23] = new Array(); I[23][1] = new Array(); I[23][1][0] = new Array(); I[23][1][0][0]='woke'; I[23][2]=''; I[24] = new Array(); I[24][1] = new Array(); I[24][1][0] = new Array(); I[24][1][0][0]='water'; I[24][2]=''; I[25] = new Array(); I[25][1] = new Array(); I[25][1][0] = new Array(); I[25][1][0][0]='getting'; I[25][2]=''; I[26] = new Array(); I[26][1] = new Array(); I[26][1][0] = new Array(); I[26][1][0][0]='broke'; I[26][2]=''; I[27] = new Array(); I[27][1] = new Array(); I[27][1][0] = new Array(); I[27][1][0][0]='shouted'; I[27][2]=''; I[28] = new Array(); I[28][1] = new Array(); I[28][1][0] = new Array(); I[28][1][0][0]='was'; I[28][2]=''; I[29] = new Array(); I[29][1] = new Array(); I[29][1][0] = new Array(); I[29][1][0][0]='die'; I[29][2]=''; I[30] = new Array(); I[30][1] = new Array(); I[30][1][0] = new Array(); I[30][1][0][0]='sat'; I[30][2]=''; I[31] = new Array(); I[31][1] = new Array(); I[31][1][0] = new Array(); I[31][1][0][0]='on'; I[31][2]=''; I[32] = new Array(); I[32][1] = new Array(); I[32][1][0] = new Array(); I[32][1][0][0]='your'; I[32][2]=''; I[33] = new Array(); I[33][1] = new Array(); I[33][1][0] = new Array(); I[33][1][0][0]='him'; I[33][2]=''; I[34] = new Array(); I[34][1] = new Array(); I[34][1][0] = new Array(); I[34][1][0][0]='door'; I[34][2]=''; I[35] = new Array(); I[35][1] = new Array(); I[35][1][0] = new Array(); I[35][1][0][0]='heard'; I[35][2]=''; I[36] = new Array(); I[36][1] = new Array(); I[36][1][0] = new Array(); I[36][1][0][0]='white'; I[36][2]=''; I[37] = new Array(); I[37][1] = new Array(); I[37][1][0] = new Array(); I[37][1][0][0]='me'; I[37][2]=''; I[38] = new Array(); I[38][1] = new Array(); I[38][1][0] = new Array(); I[38][1][0][0]='my'; I[38][2]=''; I[39] = new Array(); I[39][1] = new Array(); I[39][1][0] = new Array(); I[39][1][0][0]='head'; I[39][2]=''; I[40] = new Array(); I[40][1] = new Array(); I[40][1][0] = new Array(); I[40][1][0][0]='heard'; I[40][2]=''; I[41] = new Array(); I[41][1] = new Array(); I[41][1][0] = new Array(); I[41][1][0][0]='heard'; I[41][2]=''; I[42] = new Array(); I[42][1] = new Array(); I[42][1][0] = new Array(); I[42][1][0][0]='person'; I[42][2]=''; I[43] = new Array(); I[43][1] = new Array(); I[43][1][0] = new Array(); I[43][1][0][0]='from'; I[43][2]=''; I[44] = new Array(); I[44][1] = new Array(); I[44][1][0] = new Array(); I[44][1][0][0]='was'; I[44][2]=''; I[45] = new Array(); I[45][1] = new Array(); I[45][1][0] = new Array(); I[45][1][0][0]='make'; I[45][2]=''; I[46] = new Array(); I[46][1] = new Array(); I[46][1][0] = new Array(); I[46][1][0][0]='them'; I[46][2]=''; I[47] = new Array(); I[47][1] = new Array(); I[47][1][0] = new Array(); I[47][1][0][0]='my'; I[47][2]=''; I[48] = new Array(); I[48][1] = new Array(); I[48][1][0] = new Array(); I[48][1][0][0]='was'; I[48][2]=''; I[49] = new Array(); I[49][1] = new Array(); I[49][1][0] = new Array(); I[49][1][0][0]='she'; I[49][2]=''; I[50] = new Array(); I[50][1] = new Array(); I[50][1][0] = new Array(); I[50][1][0][0]='be'; I[50][2]=''; I[51] = new Array(); I[51][1] = new Array(); I[51][1][0] = new Array(); I[51][1][0][0]='at'; I[51][2]=''; Text = new Array(); Text[0]='It was '; Text[1]=' 1988, when I '; Text[2]=' seven years old, I used to sleep all the time, doing nothing just playing, eating and '; Text[3]=' back to bed, enjoying sleeping '; Text[4]=' a thick cover. But '; Text[5]=' day all of this changed because of a shocking experience.

One day my family '; Text[6]=' to a wedding party leaving '; Text[7]=' sleeping. They left because they knew I\'d prefer sleeping than going '; Text[8]=' them.

Suddenly, while I was half asleep at 12:00 midnight, the telephone '; Text[9]=', I jumped from the bed and I '; Text[10]=', " who would be calling at this time?" Anyway, although I was '; Text[11]=', I answered the phone, but I '; Text[12]=' nothing, so I '; Text[13]=' back to bed. After awhile the telephone '; Text[14]=' again. I said "oh no not again, who is this?" No one answered, then I '; Text[15]=' a very loud laugh. My heart began to beat quickly. I '; Text[16]=' in a softer voice, "who is this?" I '; Text[17]=' the laugh again and then the phone disconnected '; Text[18]=' itself.

I jumped to my bed and '; Text[19]=' myself with the blanket. I was shaking under the '; Text[20]=' when I '; Text[21]=' the ring again. I heard the ring several times, but I did '; Text[22]=' answer.

After an hour the telephone '; Text[23]=', so I '; Text[24]=' up and went to have a glass of '; Text[25]='. In the kitchen, while I was '; Text[26]=' the water bottle from the fridge, I saw the glasses were moving and one of them fell down and '; Text[27]='.I '; Text[28]=' loudly, and I ran quickly to my room and I locked it, I '; Text[29]=' breathing in a way I felt that I would '; Text[30]='.

I '; Text[31]=' on my chair, then I heard someone knocking '; Text[32]=' the door and saying, " hey, open, I\'m Ahmed '; Text[33]=' brother" I jumped again. I said, Ahmed, but he is in U.S. right now!" What made '; Text[34]=' to come here? I held myself and I
opened the '; Text[35]=' slowly, again I found no one, so I left the door open and I walked a bit, but I '; Text[36]=' someone calling me, "Shafika I\'m back." When I turned and I faced him, I saw a huge '; Text[37]=' ghost. I shouted and I was crying loudly, " don\'t kill '; Text[38]=' please", and I found nothing to cover '; Text[39]=' face from watching his face, so put my '; Text[40]=' into my clothes.

Then I '; Text[41]=' the same laugh again which I '; Text[42]=' on the phone. I was shaking, but I decided to see who that '; Text[43]=' was, and he was my older brother who had just come '; Text[44]=' the U.S. All that was happening, he was responsible for. He called me and he '; Text[45]=' the one who put his friend\'s pager in the glasses to '; Text[46]=' them move.

When my family returned, I told '; Text[47]=' the whole story and everyone was laughing, except '; Text[48]=' mother. She '; Text[49]=' quiet. She took me to corner and said, " listen dear, you are a very brave girl who doesn\'t know the meaning of "scared," then '; Text[50]=' left. Since that time I have been trying to '; Text[51]=' brave, but unfortunately, I\'m brave, but I\'m bashful '; Text[52]=' the same time.
'; State = new Array(); function StartUp(){ var i = 0; MixWords = new Array(); for (i=0; i -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); DisplayExercise(); RestoreCurrentAnswers(); } function TrackFocus(BoxNumber){ CurrentWord = BoxNumber; } 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('BottomFrame.document.Cloze.Gap' + GNum) != null){ RetVal = eval('BottomFrame.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('BottomFrame.document.Cloze.Gap' + GNum) != null){ eval('BottomFrame.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 Blank(){ return '©Half-Baked Software. Loading...'; } //--> //]]>