A simple multiple-choice quiz built with React. Users can answer questions, receive correct/incorrect feedback, view their final score, and play again.
- Fetches questions from the Open Trivia Database API
- Interactive answer selection with visual feedback
- Displays score and correct/incorrect answers at the end
- Option to restart the quiz
- React (with hooks)
- Vite
- CSS
- clsx (for conditional classNames)
- Open Trivia Database API – https://opentdb.com/
git clone https://github.com/joacopobre/Quizz-React-Project-.git
cd Quizz-React-Project-
npm install
npm run devWhen you load the app, you’ll see a welcome screen with a Start Quiz button. Clicking it will begin a 5-question quiz.
-
Select your answers by clicking the options.
-
Once all questions are answered, click the Check Answers button.
-
You'll see a results screen showing:
- Your score
- Which answers were correct and incorrect
- The correct answer for any you got wrong
-
Click Play Again to restart the quiz.
- The app uses clsx to dynamically assign CSS classes based on user interaction and state.
- Questions are fetched from the Open Trivia DB API each time the quiz starts or restarts.
- All questions are multiple-choice with shuffled answer options.
Joaco Pobre https://github.com/joacopobre