WEB180 - Programming Assignment #1

Collecting and Validating User Input from Web Forms

By this time, you’ve probably all seen and taken a quiz on Blackboard. Although Blackboard quizzes have several capabilities that require a database to implement, we know enough about web forms already to implement a simple quiz.

Create a quiz that first prompts the user for the following values in a web form:

These values must be validated in the following way:

  • User ID – required field
  • Password – required field, the characters typed by the user should be masked
  • Birth Date – required field, must be a date, cannot be a future date
  • Email Address – required field, must be properly formatted as an email address

Use web validation controls to perform the above input error checking. Do not allow the user to proceed to the next display if any of the input data is invalid. Make sure the user is prevented from proceeding if their browser has Javascript disabled.

The following form shows an example of the messages generated by invalid input:

Once the user has provided valid input, display a quiz for the user. The quiz should have four multiple choice questions and one essay question. The input from the previous page is used as the correct answer to each multiple choice question, basically asking the user to remember what they just entered. The essay question requires a multi-line text box. The quiz should initially appear as shown below:

The test score should be evaluated and feedback provided when the user clicks the Submit Test button. Each question is worth 2 points as indicated. The essay question is worth 12 points with one point given for each additional 10 characters in the response.

A completed quiz might appear as follows:

Notice that correct answers are noted and, in the case of incorrect answers, the correct answer is provided. Once the quiz has been graded, the form may simply be closed.

Your code should contain the following features:

  • A single web page should be used.
  • Panels should be used to provide the initial user entry form and the quiz form.
  • The validation to detect future birth dates will require some thought.
  • The birth date is used to compute the age.
  • Be careful not to allow more than 12 points for the essay question.
  • Be sure to follow the course coding standards including comments and variable naming conventions.