'; 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]='necticut'; I[0][2]=''; I[1] = new Array(); I[1][1] = new Array(); I[1][1][0] = new Array(); I[1][1][0][0]='aware'; I[1][2]=''; I[2] = new Array(); I[2][1] = new Array(); I[2][1][0] = new Array(); I[2][1][0][0]='inois'; I[2][2]=''; I[3] = new Array(); I[3][1] = new Array(); I[3][1][0] = new Array(); I[3][1][0][0]='iana'; I[3][2]=''; I[4] = new Array(); I[4][1] = new Array(); I[4][1][0] = new Array(); I[4][1][0][0]='wa'; I[4][2]=''; I[5] = new Array(); I[5][1] = new Array(); I[5][1][0] = new Array(); I[5][1][0][0]='sas'; I[5][2]=''; I[6] = new Array(); I[6][1] = new Array(); I[6][1][0] = new Array(); I[6][1][0][0]='ne'; I[6][2]=''; I[7] = new Array(); I[7][1] = new Array(); I[7][1][0] = new Array(); I[7][1][0][0]='land'; I[7][2]=''; I[8] = new Array(); I[8][1] = new Array(); I[8][1][0] = new Array(); I[8][1][0][0]='sachusetts'; I[8][2]=''; I[9] = new Array(); I[9][1] = new Array(); I[9][1][0] = new Array(); I[9][1][0][0]='higan'; I[9][2]=''; I[10] = new Array(); I[10][1] = new Array(); I[10][1][0] = new Array(); I[10][1][0][0]='nesota'; I[10][2]=''; I[11] = new Array(); I[11][1] = new Array(); I[11][1][0] = new Array(); I[11][1][0][0]='souri'; I[11][2]=''; I[12] = new Array(); I[12][1] = new Array(); I[12][1][0] = new Array(); I[12][1][0][0]='tana'; I[12][2]=''; I[13] = new Array(); I[13][1] = new Array(); I[13][1][0] = new Array(); I[13][1][0][0]='raska'; I[13][2]=''; I[14] = new Array(); I[14][1] = new Array(); I[14][1][0] = new Array(); I[14][1][0][0]='ampshire'; I[14][2]=''; I[15] = new Array(); I[15][1] = new Array(); I[15][1][0] = new Array(); I[15][1][0][0]='ersey'; I[15][2]=''; I[16] = new Array(); I[16][1] = new Array(); I[16][1][0] = new Array(); I[16][1][0][0]='ork'; I[16][2]=''; I[17] = new Array(); I[17][1] = new Array(); I[17][1][0] = new Array(); I[17][1][0][0]='akota'; I[17][2]=''; I[18] = new Array(); I[18][1] = new Array(); I[18][1][0] = new Array(); I[18][1][0][0]='io'; I[18][2]=''; I[19] = new Array(); I[19][1] = new Array(); I[19][1][0] = new Array(); I[19][1][0][0]='ahoma'; I[19][2]=''; I[20] = new Array(); I[20][1] = new Array(); I[20][1][0] = new Array(); I[20][1][0][0]='nsylvania'; I[20][2]=''; I[21] = new Array(); I[21][1] = new Array(); I[21][1][0] = new Array(); I[21][1][0][0]='de Island'; I[21][2]=''; I[22] = new Array(); I[22][1] = new Array(); I[22][1][0] = new Array(); I[22][1][0][0]='akota'; I[22][2]=''; I[23] = new Array(); I[23][1] = new Array(); I[23][1][0] = new Array(); I[23][1][0][0]='nessee'; I[23][2]=''; I[24] = new Array(); I[24][1] = new Array(); I[24][1][0] = new Array(); I[24][1][0][0]='xas'; I[24][2]=''; I[25] = new Array(); I[25][1] = new Array(); I[25][1][0] = new Array(); I[25][1][0][0]='tah'; I[25][2]=''; I[26] = new Array(); I[26][1] = new Array(); I[26][1][0] = new Array(); I[26][1][0][0]='rmont'; I[26][2]=''; I[27] = new Array(); I[27][1] = new Array(); I[27][1][0] = new Array(); I[27][1][0][0]='Virginia'; I[27][2]=''; I[28] = new Array(); I[28][1] = new Array(); I[28][1][0] = new Array(); I[28][1][0][0]='Hartford'; I[28][2]=''; I[29] = new Array(); I[29][1] = new Array(); I[29][1][0] = new Array(); I[29][1][0][0]='Dover'; I[29][2]=''; I[30] = new Array(); I[30][1] = new Array(); I[30][1][0] = new Array(); I[30][1][0][0]='Springfield'; I[30][2]=''; I[31] = new Array(); I[31][1] = new Array(); I[31][1][0] = new Array(); I[31][1][0][0]='Indianapolis'; I[31][2]=''; I[32] = new Array(); I[32][1] = new Array(); I[32][1][0] = new Array(); I[32][1][0][0]='Des Moines'; I[32][2]=''; I[33] = new Array(); I[33][1] = new Array(); I[33][1][0] = new Array(); I[33][1][0][0]='Topeka'; I[33][2]=''; I[34] = new Array(); I[34][1] = new Array(); I[34][1][0] = new Array(); I[34][1][0][0]='Augusta'; I[34][2]=''; I[35] = new Array(); I[35][1] = new Array(); I[35][1][0] = new Array(); I[35][1][0][0]='Annapolis'; I[35][2]=''; I[36] = new Array(); I[36][1] = new Array(); I[36][1][0] = new Array(); I[36][1][0][0]='Boston'; I[36][2]=''; I[37] = new Array(); I[37][1] = new Array(); I[37][1][0] = new Array(); I[37][1][0][0]='Lansing'; I[37][2]=''; I[38] = new Array(); I[38][1] = new Array(); I[38][1][0] = new Array(); I[38][1][0][0]='St. Paul'; I[38][2]=''; I[39] = new Array(); I[39][1] = new Array(); I[39][1][0] = new Array(); I[39][1][0][0]='Jefferson City'; I[39][2]=''; I[40] = new Array(); I[40][1] = new Array(); I[40][1][0] = new Array(); I[40][1][0][0]='Helena'; I[40][2]=''; I[41] = new Array(); I[41][1] = new Array(); I[41][1][0] = new Array(); I[41][1][0][0]='Lincoln'; I[41][2]=''; I[42] = new Array(); I[42][1] = new Array(); I[42][1][0] = new Array(); I[42][1][0][0]='Concord'; I[42][2]=''; I[43] = new Array(); I[43][1] = new Array(); I[43][1][0] = new Array(); I[43][1][0][0]='Trenton'; I[43][2]=''; I[44] = new Array(); I[44][1] = new Array(); I[44][1][0] = new Array(); I[44][1][0][0]='Albany'; I[44][2]=''; I[45] = new Array(); I[45][1] = new Array(); I[45][1][0] = new Array(); I[45][1][0][0]='Bismarck'; I[45][2]=''; I[46] = new Array(); I[46][1] = new Array(); I[46][1][0] = new Array(); I[46][1][0][0]='Columbus'; I[46][2]=''; I[47] = new Array(); I[47][1] = new Array(); I[47][1][0] = new Array(); I[47][1][0][0]='Oklahoma City'; I[47][2]=''; I[48] = new Array(); I[48][1] = new Array(); I[48][1][0] = new Array(); I[48][1][0][0]='Harrisburg'; I[48][2]=''; I[49] = new Array(); I[49][1] = new Array(); I[49][1][0] = new Array(); I[49][1][0][0]='Providence'; I[49][2]=''; I[50] = new Array(); I[50][1] = new Array(); I[50][1][0] = new Array(); I[50][1][0][0]='Pierre'; I[50][2]=''; I[51] = new Array(); I[51][1] = new Array(); I[51][1][0] = new Array(); I[51][1][0][0]='Nashville'; I[51][2]=''; I[52] = new Array(); I[52][1] = new Array(); I[52][1][0] = new Array(); I[52][1][0][0]='Austin'; I[52][2]=''; I[53] = new Array(); I[53][1] = new Array(); I[53][1][0] = new Array(); I[53][1][0][0]='Salt Lake City'; I[53][2]=''; I[54] = new Array(); I[54][1] = new Array(); I[54][1][0] = new Array(); I[54][1][0][0]='Montpelier'; I[54][2]=''; I[55] = new Array(); I[55][1] = new Array(); I[55][1][0] = new Array(); I[55][1][0][0]='Richmond'; I[55][2]=''; I[56] = new Array(); I[56][1] = new Array(); I[56][1][0] = new Array(); I[56][1][0][0]='Madison'; I[56][2]=''; Text = new Array(); Text[0]='
  1. Alabama
  2. Alaska
  3. Arizona
  4. Arkansas
  5. California
  6. Colorado
  7. Con'; Text[1]='
  8. Del'; Text[2]='
  9. Florida
  10. Georgia
  11. Hawaii
  12. Idaho
  13. Ill'; Text[3]='
  14. Ind'; Text[4]='
  15. Io'; Text[5]='
  16. Kan'; Text[6]='
  17. Kentucky
  18. Louisiana
  19. Mai'; Text[7]='
  20. Mary'; Text[8]='
  21. Mas'; Text[9]='
  22. Mic'; Text[10]='
  23. Min'; Text[11]='
  24. Mississippi
  25. Mis'; Text[12]='
  26. Mon'; Text[13]='
  27. Neb'; Text[14]='
  28. Nevada
  29. New H'; Text[15]='
  30. New J'; Text[16]='
  31. New Mexico
  32. New Y'; Text[17]='
  33. North Carolina
  34. North D'; Text[18]='
  35. Oh'; Text[19]='
  36. Okl'; Text[20]='
  37. Oregon
  38. Pen'; Text[21]='
  39. Rho'; Text[22]='
  40. South Carolina
  41. South D'; Text[23]='
  42. Ten'; Text[24]='
  43. Te'; Text[25]='
  44. U'; Text[26]='
  45. Ve'; Text[27]='
  46. Virginia
  47. Washington
  48. West '; Text[28]='
  49. Wisconsin
  50. Wyoming
  1. Montgomery
  2. Juneau
  3. Phoenix
  4. Little Rock
  5. Sacramento
  6. Denver
  7. '; Text[29]='
  8. '; Text[30]='
  9. Tallahassee
  10. Atlanta
  11. Honolulu
  12. Boise
  13. '; Text[31]='
  14. '; Text[32]='
  15. '; Text[33]='
  16. '; Text[34]='
  17. Frankfort
  18. Baton Rouge
  19. '; Text[35]='
  20. '; Text[36]='
  21. '; Text[37]='
  22. '; Text[38]='
  23. '; Text[39]='
  24. Jackson
  25. '; Text[40]='
  26. '; Text[41]='
  27. '; Text[42]='
  28. Carson City
  29. '; Text[43]='
  30. '; Text[44]='
  31. Santa Fe
  32. '; Text[45]='
  33. Raleigh
  34. '; Text[46]='
  35. '; Text[47]='
  36. '; Text[48]='
  37. Salem
  38. '; Text[49]='
  39. '; Text[50]='
  40. Columbia
  41. '; Text[51]='
  42. '; Text[52]='
  43. '; Text[53]='
  44. '; Text[54]='
  45. '; Text[55]='
  46. '; Text[56]='
  47. Olympia
  48. Charleston
  49. '; Text[57]='
  50. Cheyenne



'; 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...'; } //--> //]]>