A modern, responsive quiz application built with vanilla HTML, CSS, and JavaScript.
- π― Interactive Quiz Interface: Clean, modern UI with smooth animations
- π Question Randomization: Optional question shuffling with user control
- π² Random Selection Mode: Select random questions from all chapters (1-100 questions)
- π± Responsive Design: Works perfectly on desktop and mobile devices
- π Progress Tracking: Real-time progress bar and question counter
- π¨ Visual Feedback: Color-coded answers and smooth transitions
- π Detailed Results: Shows only incorrect answers with explanations
- π Retake Functionality: Start over with newly randomized questions
- π Bilingual Support: English and Greek language support
- π Section Organization: Questions organized by chapters/sections
- βοΈ User Preferences: Persistent settings for randomization and feedback
- ποΈ Feedback Modes: Immediate feedback or end-of-quiz results
- π Question Types: Support for True/False and Multiple Choice questions
- Pure Vanilla JavaScript: No frameworks or external dependencies
- Modern ES6+: Class-based architecture with async/await
- Modular Structure: Separated HTML, CSS, and JavaScript files for better maintainability
- JSON Data Source: Loads quiz data from
quiz.jsonand chapter-specific JSON files - Error Handling: Comprehensive error handling for data loading
-
Clone the repository:
git clone https://github.com/jim788e/DypaQuiz.git cd DypaQuiz -
Run locally:
# Using Python python -m http.server 8000 # Or using Node.js npx serve .
-
Open your browser and go to
http://localhost:8000
βββ index.html # Main application HTML file
βββ app.js # Application JavaScript logic
βββ styles.css # Application styles
βββ quiz.json # Main quiz configuration file
βββ Chapter1.json # Chapter 1 questions
βββ Chapter2.json # Chapter 2 questions
βββ Chapter3.json # Chapter 3 questions
βββ package.json # Project configuration
βββ vercel.json # Vercel deployment config
βββ .gitignore # Git ignore file
βββ README.md # This file
- Edit
quiz.jsonwith your questions - Keep
sample.jsonas a backup/reference - Redeploy (if using Vercel):
vercel --prod
- Default: Questions appear in serial order (as defined in quiz.json)
- Randomize: Check the "Randomize questions" checkbox to shuffle questions
- Answer Options: Always remain in serial order (A, B, C, D) regardless of randomization
- Random from all chapters: Select this option to randomly pick questions from all chapters
- Number of questions: Specify how many questions to include (1-100, default: 50)
- Fisher-Yates Algorithm: Uses proven shuffle algorithm for true randomness
- Smart Limits: Automatically adjusts if requested count exceeds available questions
- At the end: See results only after completing all questions
- After each question: Get immediate feedback on correct/incorrect answers
- English: Default language with full feature support
- Greek: Complete Greek translation for all interface elements
- Auto-detection: Automatically detects browser language preference
- Chapter Selection: Choose specific chapters or all questions
- Question Counts: See how many questions are in each section
- Filtered Quizzes: Take quizzes focused on specific topics
The application expects a JSON file with the following structure:
{
"quizTitle": "Your Quiz Title",
"questions": [
{
"id": 1,
"section": "1",
"question": "What is your question?",
"options": ["Option A", "Option B", "Option C", "Option D"],
"correctAnswer": 0,
"explanation": "Optional explanation for this answer"
}
]
}Field Descriptions:
quizTitle: The title displayed at the top of the quizquestions: Array of question objectsid: Unique identifier for each questionsection: Chapter/section identifier for organizing questionsquestion: The question textoptions: Array of answer choices (2-4 options recommended)correctAnswer: Index of the correct option (0-based)explanation: Optional explanation shown in results for wrong answers
Question Types Supported:
- True/False: Use options
["Ξ£ΟΟΟΟ", "ΞάθοΟ"]or["True", "False"] - Multiple Choice: Use 2-4 options with A, B, C, D labels
- Mixed Content: Combine both types in the same quiz
-
Install Vercel CLI:
npm i -g vercel
-
Deploy:
vercel
-
Connect to GitHub for automatic deployments on push
- Netlify: Drag and drop the folder
- GitHub Pages: Enable in repository settings
- Any static hosting: Upload the files
# Python (recommended)
python -m http.server 8000
# Node.js
npx serve .
# PHP
php -S localhost:8000quiz.json: Main quiz data - edit this file to update questionssample.json: Sample data - keep as reference/backupindex.html: Application code - no need to modify unless adding features
- Chapter Selection: Choose from available sections, all questions, or random selection
- Random Selection: Pick random questions from all chapters (1-100 questions)
- Feedback Mode: Select when to receive answer feedback
- Question Randomization: Toggle between serial and random question order
- Language Switcher: Switch between English and Greek interfaces
- Progress Tracking: Visual progress bar and question counter
- Navigation: Previous/Next buttons with smart enabling/disabling
- Answer Selection: Click or tap to select answers
- Visual Feedback: Color-coded correct/incorrect answers
- Mobile Optimized: Touch-friendly interface for mobile devices
- Score Display: Percentage and detailed score breakdown
- Wrong Answers Review: Detailed explanations for incorrect answers
- Retake Option: Start over with new question randomization
- Home Button: Return to start screen to change settings
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
- Mobile browsers (iOS Safari, Chrome Mobile)
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use and modify as needed.
Created by D.Misios
A modern, responsive quiz application built with vanilla HTML, CSS, and JavaScript.
The application includes Google Analytics 4 (GA4) tracking to monitor user engagement and quiz performance.
The tracking is already configured with Measurement ID: G-RWFSG8PFSK. If you need to change this:
- Update the Measurement ID in
index.html(line 9 and 14):<script async src="https://www.googletagmanager.com/gtag/js?id=YOUR_MEASUREMENT_ID"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'YOUR_MEASUREMENT_ID'); </script>
The application tracks the following user interactions:
quiz_started: When a user begins a quiz- Parameters: section, question_count, randomize_questions, feedback_mode, language, random_mode, random_count
quiz_completed: When a user finishes a quiz- Parameters: section, score_percentage, correct_answers, total_questions, wrong_answers, language
section_changed: When a user switches quiz sections- Parameters: old_section, new_section, language
language_changed: When a user switches the interface language- Parameters: old_language, new_language, section
quiz_retaken: When a user retakes a quiz- Parameters: section, previous_score, language
- No personal information is tracked
- No specific quiz answers are recorded
- Only aggregate performance metrics are collected
- Users can disable tracking through browser settings or ad blockers
For issues or questions:
- Create an issue on GitHub
- Check the sample.json file for data format examples
- Ensure quiz.json follows the correct structure