Multiple Fill in the Blanks Quiz
4. Add the Dropdowns
Join the Discussion
More of this Feature
All that remains to be done now for each page of your quiz is to add the form that contains the dropdown lists and the "Go" button.
Let's start by coding the form itself with the button at the bottom of the form. The code for this follows simply substitute the appropriate next page of the quiz that is to be displayed for 'next.htm'.
...
<p align="center"><input type="button" value="Go!"
onclick="test(this.form,'next.htm')" /></p>
</form>
The actual text of the quiz complete with the dropdowns goes in place of the ... in the code shown above. You can include all of the usual HTML to determine how you want the text laid out in paragraphs etc. you just replace the words that you want to test for with select boxes. For example the first line of the sample text was coded like this:
<select name="q1">
<option value="0"></option>
<option value="0">mouse</option>
<option value="1">fiddle</option>
<option value="0">rat</option>
<option value="0">guitar</option>
</select>,<br />
The important part of this code is the values that are assigned to each of the options in the list. The correct answer should have a value of "1" while all of the other options should have a value of "0". This will provide the script with sufficient information to be able to work out if all of the blanks have been filled out correctly.

