Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Quiz Game

Description

An interactive multiple-choice quiz application with various categories, scoring system, and performance ratings. Test your knowledge across different topics!

Features

  • Multiple quiz modes (Quick, Full, Category)
  • 12+ questions across 5 categories
  • Scoring system (10 points per correct answer)
  • Time tracking
  • Performance ratings
  • Category selection
  • Instant feedback
  • Statistics display

Stack

  • Language: Pure Python
  • Libraries: random, time (standard library)
  • Complexity: Beginner

Installation & Usage

No external dependencies required!

python main.py

Quiz Modes

1. Quick Quiz

  • 5 random questions
  • Mixed categories
  • Fast gameplay
  • Perfect for quick practice

2. Full Quiz

  • All available questions
  • Comprehensive test
  • All categories included
  • Complete knowledge check

3. Category Quiz

  • Choose specific category
  • Focused learning
  • Category-specific questions
  • Targeted practice

Categories

  • Python - Programming questions
  • Geography - World knowledge
  • Art - Art and artists
  • Science - Scientific facts
  • Math - Mathematical problems
  • Technology - Tech and computing

Scoring System

  • 10 points per correct answer
  • 0 points for wrong answers
  • Maximum score = Questions × 10
  • Percentage calculated automatically

Performance Ratings

Percentage Rating Message
90-100% 🌟 Excellent Outstanding performance!
75-89% 👍 Great Very good job!
60-74% 😊 Good Keep practicing!
40-59% 📚 Fair You can do better!
0-39% 💪 Keep Learning Try again!

How to Play

  1. Select Mode: Choose quiz type
  2. Read Question: Carefully read each question
  3. Select Answer: Enter number (1-4)
  4. Get Feedback: Instant correct/wrong notification
  5. View Results: See final score and rating

Example Session

==================================================
           🎯 QUIZ GAME 🎯
==================================================

Select Quiz Mode:
  1. Quick Quiz (5 questions)
  2. Full Quiz (All questions)
  3. Category Quiz
  4. Exit
==================================================

Enter your choice (1-4): 1

🎮 Starting quiz with 5 questions!
Each correct answer = 10 points

Press Enter to begin...

------------------------------------------------------------
Question 1/5 | Category: Python
------------------------------------------------------------

What is the output of: print(type([]))?

  1. <class 'tuple'>
  2. <class 'list'>
  3. <class 'dict'>
  4. <class 'set'>

Your answer (1-4): 2

✅ Correct!

📊 Current Score: 10/10

...

==================================================
           🏆 QUIZ RESULTS 🏆
==================================================

📊 Questions Answered: 5
✅ Correct Answers: 4
❌ Wrong Answers: 1
⭐ Score: 40/50
📈 Percentage: 80.0%
⏱️  Time Taken: 45.32 seconds

🎯 Rating: 👍 Great! Very good job!
==================================================

Classes

Question

  • Represents a quiz question
  • Properties: question, options, correct_answer, category
  • Methods:
    • is_correct(): Check if answer is correct
    • get_correct_option(): Get correct answer text

QuizGame

  • Main game controller
  • Methods:
    • load_questions(): Load question bank
    • ask_question(): Display and get answer
    • check_answer(): Validate answer
    • play_quiz(): Run quiz session
    • show_results(): Display final results

Learning Outcomes

  • Object-Oriented Programming
  • Data structures (lists, dictionaries)
  • User input handling
  • Conditional logic
  • Random selection
  • Time tracking
  • Score calculation
  • String formatting

Adding New Questions

Easy to extend with new questions:

Question(
    "Your question here?",
    ["Option 1", "Option 2", "Option 3", "Option 4"],
    2,  # Index of correct answer (0-3)
    "Category Name"
)

Customization Ideas

Difficulty Levels

  • Easy, Medium, Hard questions
  • Different point values
  • Time limits per question

Question Types

  • True/False questions
  • Fill in the blanks
  • Multiple correct answers

Features

  • Lifelines (50:50, skip)
  • Hints for questions
  • Explanation for answers
  • Question shuffle

Future Enhancements

  • GUI version with Tkinter
  • Question database (JSON/SQLite)
  • User accounts and profiles
  • Leaderboard system
  • Timed challenges
  • Multiplayer mode
  • Question difficulty levels
  • Achievement system
  • Export results to PDF
  • Online question bank
  • Custom quiz creation
  • Image-based questions

Educational Use

Perfect for:

  • Students: Test knowledge
  • Teachers: Create quizzes
  • Self-learning: Practice concepts
  • Interview prep: Technical questions
  • Fun: Challenge friends

Tips for Players

  • Read questions carefully
  • Don't rush
  • Eliminate wrong options first
  • Trust your first instinct
  • Learn from wrong answers
  • Practice regularly

Statistics Tracking

Current session tracks:

  • Total questions
  • Correct/wrong answers
  • Score and percentage
  • Time taken
  • Performance rating

License

Open source for educational purposes.