| The HTML code for scripttwentytwodrill.html
Finally, here is the code for the web page scripttwentytwodrill.html. Notice how much it is like the code for scriptsevendrill.html. I have used the same color coding below as in the overall listing of the javascripts found here. Like scriptsevendrill.html, there are fields and variables attached to the fields, here three per question. Remember how each must have its own unique name. Here they are ansOneHHH1, ansTwoHHH1 and DoneHHH1. hreeIt is not hard to see that, once you copy the script for this first question, by making a simple find and replace you can produce a new script with the variables ansOneHHH2, ansTwoHHH2 and DoneHHH2, then another new script with the variables ansOneHHH3, ansTwoHHH3 and DoneHHHe, and so forth. After you do something similar for the next three questions, you can go back and change the simplier variables in blue (which define the preprogrammed answers), and in red, which are the reponses, plus the text that lies outside the javascript proper. At the end I have added Script Twenty-Four which will clear all the fields of the page. It too has a fieldname that must be unique. |
| <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Mozilla/4.51 (Macintosh; U; PPC) [Netscape]"> <title>codescriptsevendrill.html</title> </head> <form> <body text="#000000" bgcolor="#FFFFFF"
link="#0000FF" vlink="#551A8B" alink="#0000FF" >
Type the accusative singular and
accusative plural of the following nouns in the spaces provided,<br>
1. puella <input TYPE="TEXT"
NAME="ansOneHHH1" SIZE="15">
<input type="button" value="Click to answer" onClick=" if( form.ansOneHHH1.value == 'puellam' && form.ansTwoHHH1.value == 'puellas') {form.DoneHHH1.value
= 'Correct. You get 2 points.'}
<input TYPE="TEXT" NAME="DoneHHH1" SIZE="60"> <br><br> 2. servus <input TYPE="TEXT"
NAME="ansOneHHH2" SIZE="15">
<input type="button" value="Click to answer" onClick=" if( form.ansOneHHH2.value == 'servum' && form.ansTwoHHH2.value == 'servos') {form.DoneHHH2.value
= 'Correct. You get 2 points.'}
<input TYPE="TEXT" NAME="DoneHHH2" SIZE="60"> <br><br> 3. dux <input TYPE="TEXT"
NAME="ansOneHHH3" SIZE="15">
<input type="button" value="Click to answer" onClick=" if( form.ansOneHHH3.value == 'ducem' && form.ansTwoHHH3.value == 'duces') {form.DoneHHH3.value
= 'Correct. You get 2 points.'}
<input TYPE="TEXT" NAME="DoneHHH3" SIZE="60"> <br><br> 4. portus <input TYPE="TEXT"
NAME="ansOneHHH4" SIZE="15">
<input type="button" value="Click to answer" onClick=" if( form.ansOneHHH4.value == 'portum' && form.ansTwoHHH4.value == 'portus') {form.DoneHHH4.value
= 'Correct. You get 2 points.'}
<input TYPE="TEXT" NAME="DoneHHH4" SIZE="60"> <br><br> 5. species <input TYPE="TEXT"
NAME="ansOneHHH5" SIZE="15">
<input type="button" value="Click to answer" onClick=" if( form.ansOneHHH5.value == 'speciem' && form.ansTwoHHH5.value == 'species') {form.DoneHHH5.value
= 'Correct. You get 2 points.'}
<input TYPE="TEXT" NAME="DoneHHH5" SIZE="60"> <br><br> <input type="reset" value="Click here to clear form" name="STARTOVER"> </form> </body>
|
Copyright 1999 Jean Alvares