V22.0005 - Spring 2003
Assignment # 6

Due: Thursday, April 10th

Projects should be posted on your I5 Web account under the name "assign6.html"

Be sure to email pnp2@cs.nyu.edu to turn in your assignment.

This assignment uses Perl/CGI, HTML and a bit of JavaScript

In brief, in this assignment you will create an Perl/CGI script that administers a quiz that has five, multiple-choice questions, grades the quiz, and stores the score for later retrieval. Your script should use cgi.pm for input.

First, create an introductory HTML page which asks the student to input their name and Net ID. When the student hits 'Submit' the first, time, he or she is presented with an HTML page that has been generated by the Perl script which has the first of five questions. It also has five radio buttons that correspond to the five choice. When the student clicks one of the buttons, it immediately sends the result back to the Perl/CGI script. (That's where the JavaScript comes in - to recognize when a button has been pressed!) Then, the Perl/CGI script sends the next question on another HTML page back to the quiz-taker.

When the fifth question has been answered, the Perl Script sends back the precentage grade, and writes the student's name, NetID and score to a text file.

The questions along with the answers should be stored in a text file on your I5 account.

Your assign6.html page should provide links to the 1) Introductory HTML page, 2) The text question file, 3) the student score file and 4) a page that displays the cgi code.

As a hint, it might be easiest to send the student name, NetID and the number-correct-so-far as hidden fields to the latest question HTML page. That way, you don't have to have a temporary file with the student information. You only have to write it out once the fifth question has been answered and append it to the student score file.