Homework:
Provide a brief description of the following JavaScript
String methods.
- charAt
- CharCodeAt
- indexOf
- replace
- split
- substr
- toUpperCase/toLowerCase
Trivia Quiz Use the arrays below to display one question at a time for the trivia quiz.
Also use split() to break the answer string into indvidual answers and display those next to
some corresponding radio button. (Supposedly the first answer is correct). Keep track of how many
answers the user got correct. Know when the quiz ends and stop the user from continuing.
Shuffle the questions and choices (so they stay together). Shuffle the individual answers.
var Question = new Array("What do the Danish call Danish pastries:", "The German word kummerspeck, meaning weight gained through comfort eating, literally means what:", "A swede is:", "Which of these was once the national drink of Scotland?", "Which of the following was a predecessor of the Milky Way bar:", "According to the International Cloud Atlas, which of these is the highest?", "Which is the deepest loch in Scotland:", "What was the first of Earth's supercontinents:", "In which country was the Can-Can invented:", "The word absinthe comes from the Greek apsinthion, meaning what:");
var Choices = new Array("Viennese Bread|Alsatian cakes|Danishpastries", "Grief bacon|Cream guzzling|Disappointment candy", "A cross between a cabbage and a turnip|A cross between a parsnip and a beetroot| A cross between fennel and carrots", "Claret|Amaretto|Vodka", "Fat Emma|Lardy Larry|Penny Plump", "Cloud zero|Cloud nine|Fog", "Loch Morar|Loch Lomand|Loch Ness", "Rodinia|Pangaea|Gondwanaland", "France|UK|Canada", "Undrinkable|Green Monster|Vomiting");
Due: Nov. 11