Deviopath › React

Quiz App

Hard · Games

Build a quiz using the QUESTIONS array.

For the current question render <h2>Question 1 of 3</h2>, <p className="question"> with the question text, one <button className="option"> per option and a "Next" button.

- Clicking an option selects it: the selected button gets the class "option selected". You can change your choice before moving on.

- "Next" is disabled until an option is selected. On the last question the button says "Finish" instead.

- Moving on counts a point if the selected option was correct, and clears the selection.

- After "Finish", show only <h2>Your score: 2 / 3</h2> and a "Try again" button that restarts the quiz from question 1 with score 0.

Next: Memory Card Game