A responsive web-based quiz application that delivers an engaging trivia experience with questions from the Open Trivia Database.
This project is a modern, interactive quiz application that fetches multiple-choice questions from the Open Trivia Database API. Users can test their knowledge across various topics with randomized questions and receive immediate feedback on their performance.
- 🔄 Dynamic Content: Real-time question fetching from Open Trivia Database API
- 🎲 Randomized Experience: Questions and answer options are shuffled for variety
- 📱 Responsive Design: Clean, user-friendly interface that works on all devices
- ✅ Real-Time Validation: Highlights unanswered questions and prevents incomplete submissions
- ⚡ Immediate Feedback: Visual indicators show correct and incorrect answers after submission
- 📄 Answer Key: Dedicated page displays all correct answers via "Show answers" button
- 🖨️ Print Support: Optimized formatting for printing quiz results
- ♿ Accessibility: Clear visual indicators and intuitive navigation
- HTML5 - Semantic markup and structure
- CSS3 - Responsive styling and animations
- JavaScript (ES6+) - Modern JavaScript features and functionality
- Fetch API - Asynchronous data retrieval
- JSON - Data processing and manipulation
- Data Fetching: Application retrieves questions from the Open Trivia Database API
- Question Processing: Questions are shuffled and limited to 30 for optimal user experience
- Answer Randomization: Answer options for each question are shuffled to prevent patterns
- User Interaction: Users select answers using intuitive radio button interface
- Validation & Feedback:
- Unanswered questions are highlighted in red
- Completed quizzes show color-coded correct/incorrect answers
- Final score displays correct answers out of total questions
quiz-application/
├── index.html # Main quiz interface
├── fasit.html # Answer key display page
├── styles.css # Application styling
├── index.js # Core quiz logic and answer checking
└── apiQuestions.js # API communication and question formatting
-
Clone the repository
git clone [https://github.com/MiaTexnes/quiz.git] cd quiz-application -
Or you can just the quiz!
This application uses the Open Trivia Database API to fetch trivia questions. The API provides:
- Multiple categories of questions
- Various difficulty levels (easy)
- Multiple choice format
- No authentication required
The quiz can be easily customized by modifying:
- Styling: Update colors, fonts, and layout in
styles.css - API parameters: Modify category, difficulty, or question type on the opentdb page.
- ✅ Chrome (latest)
- ✅ Firefox (latest)
- ✅ Safari (latest)
- ✅ Edge (latest)
Contributions are welcome! Please feel free to submit a Pull Request.
Mia Texnes
- Website: miatexnes.com
- GitHub: @miatexnes
⭐ If you found this project helpful, please consider giving it a star!