var Feedback = '';
var Correct = 'Correct!';
var Incorrect = 'Sorry! Not all of your answers are correct. Incorrect answers have been blanked out.';
var GiveHint = 'A correct letter has been added.';
var CaseSensitive = 'False';
var YourScoreIs = 'Your score is';
var platform = 'win';
var CurrentWord = 0;
var WinLowerString='abcdefghijklmnopqrstuvwxyz%9A%9C%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F8%F9%FA%FB%FC%FD%FE%FF';
var WinUpperString='ABCDEFGHIJKLMNOPQRSTUVWXYZ%8A%8C%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D8%D9%DA%DB%DC%DD%DE%9F';
var LowerString = '';
var UpperString = '';
WinAnswers = new Array();
AnswerList = new Array();
var IsWrong = 0;
WinAnswers[1] = 'don\'t have to';
WinAnswers[2] = 'don\'t have to';
WinAnswers[3] = 'don\'t have to';
WinAnswers[4] = 'don\'t have to';
WinAnswers[5] = 'mustn\'t';
WinAnswers[6] = 'mustn\'t';
WinAnswers[7] = 'mustn\'t';
WinAnswers[8] = 'mustn\'t';
WinAnswers[9] = 'don\'t have to';
WinAnswers[10] = 'don\'t have to';
WinAnswers[11] = 'don\'t have to';
WinAnswers[12] = 'don\'t have to';
WinAnswers[13] = 'don\'t have to';
WinAnswers[14] = 'don\'t have to';
WinAnswers[15] = 'don\'t have to';
WinAnswers[16] = 'don\'t have to';
WinAnswers[17] = 'mustn\'t';
WinAnswers[18] = 'mustn\'t';
WinAnswers[19] = 'mustn\'t';
WinAnswers[20] = 'mustn\'t';
WinAnswers[21] = 'doesn\'t have to';
WinAnswers[22] = 'doesn\'t have to';
WinAnswers[23] = 'doesn\'t have to';
WinAnswers[24] = 'doesn\'t have to';
WinAnswers[25] = 'mustn\'t';
WinAnswers[26] = 'mustn\'t';
WinAnswers[27] = 'mustn\'t';
WinAnswers[28] = 'mustn\'t';
WinAnswers[29] = 'mustn\'t';
WinAnswers[30] = 'mustn\'t';
WinAnswers[31] = 'mustn\'t';
WinAnswers[32] = 'mustn\'t';
platform = 'win';
for (i = 1; i < WinAnswers.length; i++){
AnswerList[i] = unescape(WinAnswers[i]);
LowerString = unescape(WinLowerString);
UpperString = unescape(WinUpperString);
}
function ConvertCase(InString, Direction){
var FromString = '';
var ToString = '';
if (Direction == 0){
FromString = UpperString;
ToString = LowerString;
}
else{
FromString = LowerString;
ToString = UpperString;
}
var i = 0;
j = 0;
var OutString = '';
for (i=0; i
j = FromString.indexOf(InString.charAt(i));
OutString += ToString.charAt(j);
}
else{
OutString += InString.charAt(i);
}
}
return OutString;
}
function CheckAllAnswers(){
var x = 0;
var y = 0;
var AnsNum = 0;
var InString = '';
IsWrong = 0;
var Answers = new Array(4);
var Tries = Math.floor((AnswerList.length) / 4);
var NumberCorrect = 0;
var Score = 0;
for (x=0; x<(document.cloze.elements.length); x++){
InString = TrimString(document.cloze.elements[x].value);
AnsNum = (x*4) +1;
Answers[1] = AnswerList[AnsNum];
Answers[2] = AnswerList[AnsNum+1];
Answers[3] = AnswerList[AnsNum+2];
Answers[4] = AnswerList[AnsNum+3];
if (CaseSensitive == 'False') {
InString = ConvertCase(InString, 1);
for (y=1; y<5; y++) {
Answers[y] = ConvertCase(Answers[y], 1);
}
}
if ((InString == Answers[1]) || (InString == Answers[2]) ||(InString == Answers[3]) || (InString == Answers[4])) {
NumberCorrect++;
}
else {
IsWrong = 1;
document.cloze.elements[x].value = '';
}
}
Score = Math.floor((NumberCorrect*100)/Tries);
if (IsWrong == 1) {
Feedback = Incorrect;
Feedback+= '
' + YourScoreIs + ' ' + Score + '%.';
}
else {
Feedback = Correct;
Feedback+= ' ' + YourScoreIs + ' ' + Score + '%.'+ '
';
}
WriteFeedback(Feedback);
}
function TrimString(InString){
var x = 0;
if (InString.length != 0) {
while ((escape(InString.charAt(InString.length - 1)) == '%20') || (escape(InString.charAt(InString.length - 1)) == '%0A') || (escape(InString.charAt(InString.length - 1)) == '%0D')){
InString = InString.substring(0, InString.length - 1);
}
while ((escape(InString.charAt(0)) == '%20') || (escape(InString.charAt(0)) == '%0A') || (escape(InString.charAt(0)) == '%0D')){
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 WriteFeedback(Feedback) {
var x=document.getElementById("xfeedback")
var e = window.event
getMouseXY(e)
//x.style.top="300px"
//x.style.left="100px"
//alert(mY)
x.style.left=mX+20+"px"
x.style.top=mY-25+"px"
x.style.visibility="visible"
x.innerHTML=Feedback
//Object.style.visibility=visible|hidden|collapse
//alert(Feedback);
}
function getMouseXY(e) {
var IE = document.all?true:false;
if (IE) { // grab the x-y pos.s if browser is IE
mX = document.body.scrollLeft;
mY = document.body.scrollTop;
}
else { // grab the x-y pos.s if browser is NS
mX = e.pageX;
mY = e.pageY;
}
}
function HideFeedback() {
document.getElementById("xfeedback").style.visibility="hidden" ;
}
function Cheat(){
CurrentAnswers = new Array(4);
CorrectBits = new Array(4);
var CurrentAnswer = FindCurrent();
if (CurrentAnswer == -1) {
return;
}
CurrentAnswers[1] = AnswerList[(CurrentAnswer * 4) + 1];
CurrentAnswers[2] = AnswerList[(CurrentAnswer * 4) + 2];
CurrentAnswers[3] = AnswerList[(CurrentAnswer * 4) + 3];
CurrentAnswers[4] = AnswerList[(CurrentAnswer * 4) + 4];
CorrectBits[1] = CheckBeginning(document.cloze.elements[CurrentAnswer].value, CurrentAnswers[1]);
CorrectBits[2] = CheckBeginning(document.cloze.elements[CurrentAnswer].value, CurrentAnswers[2]);
CorrectBits[3] = CheckBeginning(document.cloze.elements[CurrentAnswer].value, CurrentAnswers[3]);
CorrectBits[4] = CheckBeginning(document.cloze.elements[CurrentAnswer].value, CurrentAnswers[4]);
Longest = FindLongest(CorrectBits[1], CorrectBits[2], CorrectBits[3], CorrectBits[4]);
document.cloze.elements[CurrentAnswer].value = CorrectBits[Longest];
WriteFeedback(GiveHint);
}
function TrackFocus(BoxNumber){
CurrentWord = BoxNumber;
}
function CheckBeginning(Guess, Answer){
var OutString = '';
var i = 0;
var UpperGuess = '';
var UpperAnswer = '';
if (CaseSensitive == 'False') {
UpperGuess = ConvertCase(Guess, 1);
UpperAnswer = ConvertCase(Answer, 1);
}
else {
UpperGuess = Guess;
UpperAnswer = Answer;
}
while (UpperGuess.charAt(i) == UpperAnswer.charAt(i)) {
OutString += Guess.charAt(i);
i++;
}
OutString += Answer.charAt(i);
return OutString;
}
function CheckAnswer(Guess, AnsNum){
if (CaseSensitive == 'True'){
if ((Guess == AnswerList[(AnsNum * 4) + 1]) || (Guess == AnswerList[(AnsNum * 4) + 2]) || (Guess == AnswerList[(AnsNum * 4) + 3]) || (Guess == AnswerList[(AnsNum * 4) + 4])) {
return true;
}
else {
return false;
}
}
else{
Guess = ConvertCase(Guess, 1);
if ((Guess == ConvertCase(AnswerList[(AnsNum * 4) + 1], 1)) || (Guess == ConvertCase(AnswerList[(AnsNum * 4) + 2], 1)) || (Guess == ConvertCase(AnswerList[(AnsNum * 4) + 3], 1)) || (Guess == ConvertCase(AnswerList[(AnsNum * 4) + 4], 1))) {
return true;
}
else {
return false;
}
}
}
function FindCurrent() {
var FoundCurrent = -1;
var x = 0;
if (CheckAnswer(document.cloze.elements[CurrentWord].value, CurrentWord) == false) {
FoundCurrent = CurrentWord;
}
else {
x=CurrentWord + 1;
while ((FoundCurrent == -1) && (x
FoundCurrent = x;
}
x++;
}
}
if (FoundCurrent == -1){
x = 0;
while ((FoundCurrent == -1) && (x
FoundCurrent = x;
}
x++;
}
}
return FoundCurrent;
}
function FindLongest(First, Second, Third, Fourth){
var Longest = 0;
var LongString = '';
Longest = 4;
LongString = Fourth;
if (Third.length >= LongString.length){
Longest = 3;
LongString = Third;
}
if (Second.length >= LongString.length){
Longest = 2;
LongString = Second;
}
if (First.length >= LongString.length){
Longest = 1;
LongString = First;
}
return Longest;
}
For each space, decide whether "don't have to" or "mustn't" is best, then type in the correct form. When you have finished, click on "Check".
If you need help, you can click on "Hint" to get a free letter.
"Don't have to" or "Mustn't"?