A quiz game

The problem

Build a browser quiz that asks one question at a time, tells the player whether each answer was right, and shows a final score with a chance to play again.

Requirements

Technologies

Step by step

  1. Write the questions as an array of objects, each with the text, the options and the index of the right answer.
  2. Write the HTML for the page, with an empty area for the question.
  3. Keep the state in a few variables: the current question and the score.
  4. Write one render function that draws the current question from the state.
  5. Use one click listener on the answers area to find which answer was chosen.
  6. Mark the right and wrong answers with classes, and update the score.
  7. Add the Next button, then the end screen, and finally Play again.
  8. Test it with only the keyboard, and with a question that has a long answer.

Expected result

A complete game that can be played repeatedly, with the page always drawn from one small set of variables.

How it is evaluated

Ways to improve it