<HEAD>

<SCRIPT>
var rightinonetry = 0
var rightintwotries = 0
var rightinthreetries = 0
var totalRight=0
var wrongresponsesq1 = 0
var wrongresponsesq2 = 0
var wrongresponsesq3 = 0
donefirst=0
donesecond=0
donethird=0

function rightAnswer() {
parent.frames[0].document.clear();
parent.frames[0].document.open();
parent.frames[0].document.writeln ('<html>');
parent.frames[0].document.writeln ('<body bgcolor = FFFFFF text = 7f0000>');
parent.frames[0].document.writeln ('<font size = +1>');
parent.frames[0].document.writeln ('<center>');
parent.frames[0].document.writeln ("<b>Very good, " + parent.frames[1].document.forms[0].username.value +", keep going!</b>");
parent.frames[0].document.writeln ('</center></font>');
parent.frames[0].document.close();
}

function wrongAnswer() {
parent.frames[0].document.clear();
parent.frames[0].document.open();
parent.frames[0].document.writeln ('<html>');
parent.frames[0].document.writeln ('<body bgcolor = FFFFFF text = 7f0000>');
parent.frames[0].document.writeln ('<font size = +1>');
parent.frames[0].document.writeln ('<center>');
parent.frames[0].document.writeln ("<b>Sorry, " + parent.frames[1].document.forms[0].username.value +", try again!</b>");
parent.frames[0].document.writeln ('</center></font>');
parent.frames[0].document.close();
}

function maxWrong() {
parent.frames[0].document.clear();
parent.frames[0].document.open();
parent.frames[0].document.writeln ('<html>');
parent.frames[0].document.writeln ('<body bgcolor = FFFFFF text = 7f0000>');
parent.frames[0].document.writeln ('<font size = +1>');
parent.frames[0].document.writeln ('<center>');
parent.frames[0].document.writeln ('<b>Sorry , ');
parent.frames[0].document.writeln ('<br>that was your third try<b>');
parent.frames[0].document.writeln ('</center></font>');
parent.frames[0].document.close();
}

function allDone() {
   percent = Math.round((totalRight / 3) * 100)
   end = new Date()
   timer = (end.getTime()  - begin.getTime()) / 1000
   if (timer < 60) {
      timereturn = timer + " seconds"
      }
   else {
      timereturn = Math.round(timer / 60) + " minutes"
   }
   document.forms[0].q1.value='' 
   document.forms[0].q2.value=''
   document.forms[0].q3.value=''
   if (totalRight == "0") {
       feedback = "Yikes -- did you even try?"
    }
   if (totalRight == "1") {
       feedback = "Pretty bad -- Better review your Abbot and Costello!"
    }
   if (totalRight == "2") {
      feedback = "Respectable -- but you could do better."
    }
   if (totalRight == "3") {
       feedback = "YEEESS!"
    }
parent.frames[0].document.clear();
parent.frames[0].document.open();
parent.frames[0].document.writeln ('<html>');
parent.frames[0].document.writeln ('<body bgcolor = FFFFFF text = 7f0000>');
parent.frames[0].document.writeln ('<font size = +1>');
parent.frames[0].document.writeln ('<center>');
parent.frames[0].document.writeln ('Out of 3 questions, you got<b> ' + totalRight + '</b> right for a score of<b> ' + percent + '%</b>.<br>');
parent.frames[0].document.writeln ('Right in one try: <b>' + rightinonetry);
parent.frames[0].document.writeln ('</b>   Right in two tries: <b>' + rightintwotries);
parent.frames[0].document.writeln ('</b>   Right in three tries: <b>' + rightinthreetries);
parent.frames[0].document.writeln ('</b><br>It took you <b>' + timereturn + '</b> to complete the exercise.');
parent.frames[0].document.writeln ('</b></center></font>');
parent.frames[0].document.close();
totalRight="0";
}
function checkAnswer1(test) {
if (test == 'Who'||test == 'who') {
     if (donefirst == "1") {
          document.forms[0].q1.value="[This question already completed]"
          document.forms[0].q2.focus() 
          wrongresponsesq1 = 0
      }
     else {
        document.forms[0].q1.value="You got it!" 
        document.forms[0].q2.focus() 
        if (wrongresponsesq1 == "0") {
           rightinonetry++
        }
        if (wrongresponsesq1 == "1") {
           rightintwotries++
        }
        if (wrongresponsesq1 == "2") {
           rightinthreetries++
        }
        wrongresponsesq1 = 0
        rightAnswer()   
        donefirst=1
        totalRight++
       }
}
  else {
      wrongresponsesq1++
       document.forms[0].q1.focus()
       document.forms[0].q1.select(this.value)
       wrongAnswer()
          if (wrongresponsesq1 == 2) {
          document.forms[0].q1.value="HINT:  The answer's in the question."
          document.forms[0].q1.focus()
          document.forms[0].q1.select()
         } 
          if (wrongresponsesq1 == 3) {
          alert('\n\nCORRECT RESPONSE:   "Who"\n\n')
          document.forms[0].q2.focus()
          maxWrong()
          wrongresponsesq1 = 0
          donefirst=1
         } 
     }   
}
function checkAnswer2(test) {
if (test == 'What'||test == 'what') {
   if (donesecond == "1") {
          document.forms[0].q2.value="[This question already completed]"
          document.forms[0].q3.focus() 
          wrongresponsesq2 = 0
      }
     else {
       document.forms[0].q2.value="You must have heard this before." 
       document.forms[0].q3.focus() 
      if (wrongresponsesq2 == "0") {
           rightinonetry++
        }
        if (wrongresponsesq2 == "1") {
           rightintwotries++
        }
        if (wrongresponsesq2 == "2") {
           rightinthreetries++
        }
      wrongresponsesq2 = 0
       rightAnswer()
      donesecond=1
      totalRight++
    }
}
else {
    wrongresponsesq2++
    document.forms[0].q2.focus()
    document.forms[0].q2.select(this.value)
    wrongAnswer()
          if (wrongresponsesq2 == 2) {
          document.forms[0].q2.value='HINT:  Another interrogative pronoun.'
          document.forms[0].q2.focus()
          document.forms[0].q2.select()
         } 
          if (wrongresponsesq2 == 3) {
          alert('CORRECT RESPONSE:   "What"')
          document.forms[0].q3.focus()
          maxWrong()
          wrongresponsesq2 = 0
           donesecond=1
         } 
     }   
}
function checkAnswer3(test) {
    if (test == 'yes'||test == 'Yes') {
       if (donethird == "1") {
          document.forms[0].q3.value="[This question already completed]"
          wrongresponsesq3 = 0
      }
     else {
       document.forms[0].q3.value="Yahoo!" 
      if (wrongresponsesq3 == "0") {
           rightinonetry++
        }
        if (wrongresponsesq3 == "1") {
           rightintwotries++
        }
        if (wrongresponsesq3 == "2") {
           rightinthreetries++
        }
       wrongresponsesq3 = 0
       rightAnswer()
       donethird=1
      totalRight++
    }
}
else {
    wrongresponsesq3++
    document.forms[0].q3.focus()
    document.forms[0].q3.select(this.value)
    wrongAnswer()
          if (wrongresponsesq3 == 2) {
          document.forms[0].q3.value='HINT: This is actually a yes or no question.'
          document.forms[0].q3.focus()
          document.forms[0].q3.select()
         } 
          if (wrongresponsesq3 == 3) {
          donethird=1
          alert('CORRECT RESPONSE:   "Yes"')
          maxWrong()
          wrongresponsesq3 = 0
         } 
     }   
 }
function checkit1() {
if (donefirst == "1") {
          document.forms[0].q1.value="[This question already completed]"
          document.forms[0].q2.focus() 
}}

function checkit2() {
if (donesecond == "1") {
          document.forms[0].q2.value="[This question already completed]"
          document.forms[0].q3.focus() 
}}

function checkit3() {
if (donethird == "1") {
          document.forms[0].q1.value="[This question already completed]"
}}

// end hiding scripting -->
</SCRIPT></HEAD>
<body bgcolor=f6cd93 text=7f0000 LINK=01271D VLINK=01271D><CENTER>
<b><i>Fill in your answer and then click on the check mark.<br>Note that you have a maximum of three tries for each question.</i></CENTER>
</a><br><form method=post>
What's your name?
<input name=username><br><dl><dl><table>
<tr><td><b>1.  Who's on first? </td>
<td></td><td></td><tr>
<td><INPUT TYPE=text NAME=q1 SIZE=50 MAXLENGTH=50 onFocus=checkit1()></td>
<td><A HREF = javascript:checkAnswer1(document.forms[0].q1.value) >
<img src = check.gif border=2 ></A></td></tr>
<tr><td><b>2.  Who's on second?</td>
<td></td><td></td><tr>
<td><INPUT TYPE=text NAME=q2 SIZE=50 MAXLENGTH=50 onFocus=checkit2()></td>
<td><A HREF = javascript:checkAnswer2(document.forms[0].q2.value)>
<img src = check.gif border=2></A></td></tr>
<tr><td><b>3.  What's on second?</td>
<td></td><td></td><tr>
<td><INPUT TYPE=text NAME=q3 SIZE=50 MAXLENGTH=50 onFocus=checkit3()></td>
<td><A HREF = javascript:checkAnswer3(document.forms[0].q3.value)>
<img src = check.gif border=2></A></td></tr></table>
<input type=button value="Click when done" onClick=allDone()>
</dl></dl></b>
</form>
<script>
onLoad=begin = new Date(); rightinonetry = "0"; rightintwotries = "0";rightinthreetries = "0"
</script>
</BODY>