'; 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 four question objects... quiz = new makeArray(8); quiz[0] = new makeQuestion("How many species of catfish are there in the world?", // 1st question 2, // correct answer "100", // choice 0 "50", // choice 1 "2000", // choice 2 "500"); // choice 3 quiz[1] = new makeQuestion("What does the Weberian mechanism give the carp ?", // 2nd question 0, // correct answer "Good hearng", // choice 0 "The ability to swim fast", // choice 1 "Blue coloring", //choice 2 "Big body"); quiz[2] = new makeQuestion("How many eggs can a female mosquito have in her lifetime?", 3, "5000", "100", "2000", "3500"); quiz[3] = new makeQuestion("How long was the dam in Rocky Mountain National Park?", 1, "100", "1000", "79", "2459"); quiz[4] = new makeQuestion("About how many bald eagles stay in Klamath Falls in the winter?", // 1st question 3, // correct answer "300", // choice 0 "100", // choice 1 "5000", // choice 2 "600"); // choice 3 // --> quiz[5] = new makeQuestion("What kind of mosquitos bite?", 1, "male", "female", "old males", "young males"); quiz[6] = new makeQuestion("How many types of beavers live in North America?", 0, "1", "27", "3", "54"); quiz[7] = new makeQuestion("How many barbels do catfish usaully have?", 2, "1", "2 to 4", "7 to 10", "10 to 12");

My Quiz

Correct Quiz