JavaScript
$(document).ready(function() {
"use strict";
var questions = [{
question: "What is defined in physics as 'a nuclear reaction in which nuclei combine to form more massive nuclei'?",
choices: ['fission', 'fusion', 'farking', 'fracking', 'freaking'],
correctAnswer: 1
}, {
question: "What is the capital of Australia?",
choices: ["Melbourne", "Sydney", "Canberra", "Queensland", "Christchurch"],
correctAnswer: 2
}, {
question: "Who is the prime minister of the U.K.?",
choices: ['Tony Blair', 'David Cameron', 'Nicolas Sarkozy', 'Gordon Brown', 'Sir John Major'],
correctAnswer: 1
}, {
question: "What is the first perfect number?",
choices: [38, 6, 0, 256, 28],
correctAnswer: 1
}, {
question: "What colors are on the flag of Norway?",
choices: ["red and blue", "red and white", "red, white, and silver", "red, white, and blue", "blue and gold"],
correctAnswer: 3
}, {
question: "When did the Soviet Union collapse?",
choices: ["14 February 1989", "1 January 1988", "31 October 1993", "26 April 1986", "26 December 1991"],
correctAnswer: 4
}, {
question: "What is the currency of Switzerland?",
choices: ["franc", "Euro", "rupee", "won", "dollar"],
correctAnswer: 0
}, {
question: "What is the square root of 256?",
choices: [24, 25, 30, 26, 22],
correctAnswer: 0
}, {
question: "What are the three main types of rocks?",
choices: ['igneous, volcanic, quartz', 'sedimentary, igneous, metamorphic', 'feldspar, metamorphic, sedimentary', 'gargantuan, feldspar, quartz', 'None of the above'],
correctAnswer: 1
}, {
question: "What movie did Leonardo DiCaprio win a BAFTA Film Award for?",
choices: ['Inception', "What's Eating Gilbert Grape", 'The Revenant', 'The Wolf of Wall Street', 'He never got one.'],
correctAnswer: 2
}];
var questionCounter = 0; //Tracks question number
var selections = []; //Array containing user choices
var quiz =...