In this assignment, we create a web application to help learn vocabulary words. The web site freevocabulary.com contains a list of about 5000 words and short definitions. I have extracted this list into the file /home/unixtool/data/vocab.dat. Your task is to write a CGI script that presents and grades a vocabulary quiz.
The first part of this is creating the quiz. For this, your CGI script will pick ten random words from the data file, and for each of these present four definitions (one correct and three incorrect ones). The user will pick the correct definitions by using an appropriate HTML form element (such as radio or drop down menu).
When the form is submitted, another CGI script will grade the test and report the results. This is the second part of the assignment.
Here's an outline as to how you might want to write this program (note that you are free to implement it however you want, this is just a suggestion):
The file format is word|part-of-speech|definition. For example,
muddle|v.|To confuse or becloud, especially with or as with drink.You can ignore the second field (part of speech).
To see a working version of this assignment, click here. You are encouraged but not required to make your output look nicer than that. (FYI: the version linked to is written in ksh, each part is 24 lines).
When you have finished, submit using the homework submission system.