'; 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 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]='est mort'; I[0][2]=''; I[1] = new Array(); I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='est d\u00E9c\u00E9d\u00E9'; I[1][2]=''; I[2] = new Array(); I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='a \u00E9t\u00E9 cr\u00E9\u00E9e'; I[2][2]=''; I[3] = new Array(); I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='a \u00E9t\u00E9 lanc\u00E9e'; I[3][2]=''; I[4] = new Array(); I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='a \u00E9t\u00E9 agrandi'; I[4][2]=''; I[5] = new Array(); I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='ont menac\u00E9 de faire'; I[5][2]=''; I[6] = new Array(); I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='a \u00E9t\u00E9 \u00E9lu'; I[6][2]=''; I[7] = new Array(); I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='a \u00E9t\u00E9 battu'; I[7][2]=''; I[8] = new Array(); I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='ont \u00E9t\u00E9 r\u00E9\u00E9dit\u00E9s'; I[8][2]=''; I[9] = new Array(); I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='a trembl\u00E9'; I[9][2]=''; I[10] = new Array(); I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='a \u00E9t\u00E9 attribu\u00E9'; I[10][2]=''; I[11] = new Array(); I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='ont \u00E9t\u00E9 lib\u00E9r\u00E9s'; I[11][2]=''; I[12] = new Array(); I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='a \u00E9t\u00E9 arr\u00EAt\u00E9'; I[12][2]=''; I[13] = new Array(); I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='a \u00E9t\u00E9 tu\u00E9'; I[13][2]=''; I[14] = new Array(); I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='a \u00E9t\u00E9 diffus\u00E9'; I[14][2]=''; I[15] = new Array(); I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='a promis'; I[15][2]=''; I[16] = new Array(); I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='ont \u00E9t\u00E9 massacr\u00E9s'; I[16][2]=''; I[17] = new Array(); I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='a tent\u00E9'; I[17][2]=''; I[18] = new Array(); I[18][1] = new Array(); I[18][1][0] = new Array(); I[18][1][0][0]='ont augment\u00E9'; I[18][2]=''; Text = new Array(); Text[0]='Exemple: Diminution de la production automobile (diminuer)
La production automobile a diminu\u00E9.

1) Mort de Louis Chauvet (mourir) = Louis Chauvet '; Text[1]='.

2) D\u00E9c\u00E8s de M. Branche, d\u00E9put\u00E9 (d\u00E9c\u00E9der) = M. Branche, d\u00E9put\u00E9, '; Text[2]='.

3) Cr\u00E9ation d\'une nouvelle croix de guerre (cr\u00E9er) = Une nouvelle croix de guerre '; Text[3]='.

4) Lancement de Colombia, nouvelle navette spatiale (lancer) = Colombia, nouvelle navette spatiale, '; Text[4]='.

5) Agrandissement de l\'h\u00F4pital Saint-Paul (agrandir) = L\'h\u00F4pital Saint-Paul '; Text[5]='.

6) Menace de gr\u00E8ve illimit\u00E9e des inspecteurs des permis de conduire (menacer de faire) = Les inspecteurs des permis de conduire '; Text[6]=' une gr\u00E8ve illimit\u00E9e.

7) \u00C9lection du nouveau Pr\u00E9sident de la R\u00E9publique (\u00E9lire) = Le nouveau Pr\u00E9sident de la R\u00E9publique '; Text[7]='.

8) \u00C9chec du pr\u00E9sident sortant (battre) = Le pr\u00E9sident sortant '; Text[8]='.

9) R\u00E9\u00E9dition des Contes (m.) de Perrault (r\u00E9\u00E9diter) = Les Contes de Perrault '; Text[9]='.

10) Tremblement de terre au Japon (trembler) = Au Japon, la terre '; Text[10]='.

11) Attribution du prix Goncourt \u00E0 un inconnu (attribuer) = Le prix Goncourt '; Text[11]=' \u00E0 un inconnu.

12) Lib\u00E9ration des gardes (m.) civils (lib\u00E9rer) = Les gardes civils '; Text[12]='.

13) Arrestation d\'un g\u00E9n\u00E9ral \u00E0 La Paz (arr\u00EAter) = Un g\u00E9n\u00E9ral '; Text[13]=' \u00E0 La Paz.

14) Mort d\'un policier au cours d\'un hold-up (tuer) = Un policier '; Text[14]=' au cours d\'un hold-up.

15) Diffusion d\'un nouveau livre russe sur le march\u00E9 (diffuser) = Un nouveau livre russe '; Text[15]=' sur le march\u00E9.

15) Promesse de changements de la part du nouveau directeur (promettre) = Le nouveau directeur '; Text[16]=' des changements.

16) Au Liban, massacre des Chr\u00E9tiens (massacrer) = Au Liban, des Chr\u00E9tiens '; Text[17]='.

17) Tentative de suicide du fr\u00E8re du condamn\u00E9 \u00E0 mort (tenter) = Le fr\u00E8re du condamn\u00E9 \u00E0 mort '; Text[18]=' de se suicider.

18) Augmentation des demandes d\'emploi (augmenter) = Les demandes d\'emploi '; Text[19]='. '; State = new Array(); function StartUp(){ var i = 0; State.length = 0; 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... '; } //--> //]]> -->