CSC 551: Web Programming
Spring 2002

HW3: JavaScript Programming

Create a Web page named quiz.html that can be used to conduct multiple choice quizzes over the Web. The page should contain at least 10 potential quiz questions, each with three possible answers (A, B, and C). When loaded, the page should first prompt the person for the number of desired questions in the quiz, with a default of 5 questions. The page should then randomly select questions and prompt the user with each question and possible answers. Each answer entered by the user should be compared with the correct answer, and the result displayed within the page (either CORRECT or INCORRECT). At the end, the number and percentage of correct guesses should be displayed in the page.

Note: the specific look and feel of this page is left intentionally vague, allowing considerable design freedom on your part. Your page must be clear and understandable to the user, and support the following:

For example, the page might contain the following as a result of a 5-question quiz:

What is the capital of Missouri? You guessed B) Jefferson City CORRECT How many ounces in a pound? You guessed A) 10 INCORRECT: the correct answer is C) 16 Who was the first person to set foot on the moon? You guessed C) Neil Armstrong CORRECT Who holds the Major League Baseball record for most home runs in a season? You guessed A) Barry Bonds CORRECT In what year was Creighton University founded? You guessed A) 1778 INCORRECT: the correct answer is B) 1878 You answered 3 out of 5 questions correctly (60%).