'; for (var i = 0; i < quiz.length; i++) { if (quiz[i].isCorrect()) correct++; } var score = Math.round((correct / quiz.length) * 100); correctPage += 'Score: ' + score + ' %'; if (correct < quiz.length) { correctPage += ifWrong; for (var i = 0; i < quiz.length; i++) { if (!quiz[i].isCorrect()) { correctPage += (i + 1) + '. ' + quiz[i].userChoices[quiz[i].correctAnswer] + '
'; } } } else correctPage += ifAced; correctPage += ''; correctwin = window.open ('', '', 'height=300,width=300,scrollbars=yes'); if (correctwin.opener == null) correctwin.opener = window; correctwin.location = 'javascript:opener.correctPage'; } // Message to display if quiz is aced. var ifAced = "

Well done, you aced it.

"; // Message to display if any are wrong. var ifWrong = "

Here are the correct answers to the questions you got wrong:

"; // Create ten question objects... quiz = new makeArray(10); quiz[0] = new makeQuestion("What\'s engraved on Anna\'s locket?", // 1st question 2, // correct answer "hearts", // choice 0 "initials", // choice 1 "roses", // choice 2 "stars"); // choice 3 quiz[1] = new makeQuestion("What is Erica\'s father\'s name?", 0, "Dieter", "Hans", "Eddie", "Wilhelm"); quiz[2] = new makeQuestion("What does Ginevra crave whenever she\'s pregnant?", 3, "chocolate", "pink gin", "eclairs", "oranges"); quiz[3] = new makeQuestion("How old was Margaret when she married Bobby?", 1, "eighteen", "sixteen", "twenty-three", "twenty"); quiz[4] = new makeQuestion("How many cows did Harry count in the field?", 0, // correct answer "six", "ten", "five", //choice 2 "eight"); quiz[5] = new makeQuestion("Where did Robert meet Death?", 2, "the Matterhorn", "the Coolins of Rhum", "Ben Nevis", "the Shipway"); quiz[6] = new makeQuestion("What\'s the first music Harry ever plays on Kester\'s white Steinway grand?", 1, "The Blue Danube", "a Chopin polonaise", "The Dead March from Saul", "The Black Bottom"); quiz[7] = new makeQuestion("Where did Kester hang the Picasso?", 3, "in the ballroom", "in the bedroom", "on the landing", "in the lavatory"); quiz[8] = new makeQuestion("Who is Aunt Ethel\'s favorite nephew?", 3, "Robert", "John", "Edmund", "Thomas"); quiz[9] = new makeQuestion("Where does John spend his third honeymoon?", 2, "Suffolk", "Gower", "Cornwall", "the Riviera"); // -->

The Wheel of Fortune by Susan Howatch
Trivia Quiz

Check Your Answers

Check Your Answers

Howatch discussion list home page

1