A professional interactive quiz application built with Java Swing for the Object-Oriented Programming Lab at United International University. Features a modern Material Design interface for creating, managing, and taking quizzes with real-time feedback and comprehensive performance tracking.
- Interactive Quiz Interface - Live progress tracking and real-time scoring
- Progress Bar - Visual feedback on quiz completion
- Instant Feedback - Score updates as you answer each question
- Professional Results - Detailed performance breakdown with letter grades
- GUI-Based Management - Add, delete, and manage questions without file editing
- Input Validation - Comprehensive validation ensures data integrity
- Instant Persistence - Questions auto-saved to
questions.txt - Unique Questions - Prevents duplicate question entries
- Automatic Scoring - Real-time calculation of quiz performance
- Letter Grades - A+, A, B, C, F based on percentage
- Performance Feedback - Clear feedback on quiz results
- Retake Option - Ability to retake quizzes for improvement
- Material Design 2019 - Professional color palette and design
- Gradient Backgrounds - Visually appealing interface
- Color-Coded Actions - Intuitive button colors (green=success, red=cancel, blue=navigation)
- Responsive Layout - Clean, organized interface elements
| Component | Technology |
|---|---|
| Language | Java 8+ |
| GUI Framework | Swing |
| Storage | Text file (questions.txt) |
| Architecture | Component-based (MVC-like) |
| Dependencies | None (Pure Java) |
- Java Development Kit (JDK): Version 8 or higher
- Download from Oracle JDK or OpenJDK
- Verify installation:
java -version
- Git (optional, for cloning)
# Clone the repository
git clone https://github.com/litch07/quiz-master-java.git
cd quiz-master-java
# Compile all Java files
javac *.java
# Run the application
java MainThe application will launch with a Dashboard containing four main options:
- Start Quiz - Begin taking a quiz
- Manage Questions - Add/delete questions
- Statistics - View quiz statistics
- Exit - Close the application
- From the Dashboard, click "Manage Questions"
- Click "+ Add New Question" button
- Enter your question text in the text area
- Fill in all four multiple-choice options
- Select the correct answer from the dropdown menu
- Click "Save Question" - changes are instantly saved
Requirements:
- โ Questions must have unique text
- โ All four options must be filled
- โ The correct answer must match one of the options exactly
- From the Dashboard, click "Start Quiz"
- Review the quiz information and click "Start Quiz" to begin
- Read each question and select your answer by clicking one of the four option buttons
- Click "Next Question" to proceed
- On the final question, the button changes to "Finish Quiz"
- Submit your answers to see detailed results
Scoring:
- Each correct answer = 1 point
- Progress bar shows your position in the quiz
- Score updates in real-time as you answer
| Letter Grade | Percentage | Description |
|---|---|---|
| A+ | 90-100% | Excellent |
| A | 80-89% | Very Good |
| B | 70-79% | Good |
| C | 60-69% | Satisfactory |
| F | Below 60% | Needs Improvement |
Questions are stored in questions.txt in a simple, human-readable format:
What is the capital of France?
London
Berlin
Paris
Madrid
Paris
Format Specification:
- Line 1: Question text
- Lines 2-5: Four answer options
- Line 6: Correct answer (must match one of the options exactly)
- Each question is 6 consecutive lines
- Blank lines separate questions
Example with Multiple Questions:
What is 2 + 2?
3
4
5
6
4
Who wrote Romeo and Juliet?
Christopher Marlowe
William Shakespeare
Ben Jonson
John Webster
William Shakespeare
Main.java
โโโ Loads questions from questions.txt
โโโ Initializes Dashboard
Dashboard.java
โโโ Navigation hub with 4 main buttons
โโโ Connects to:
โโโ StartQuiz.java โ Quiz flow
โโโ QuestionManager.java โ CRUD operations
โโโ Exit
StartQuiz.java
โโโ Quiz confirmation screen
โโโ MainWindow.java โ Main quiz interface
โโโ ResultsWindow.java โ Results & grading
Questions.java
โโโ Data model (question, options, answer)
QuestionManager.java
โโโ GUI for question management
โโโ Saves/loads from questions.txt
ResultsWindow.java
โโโ Displays results with grading system
questions.txt
โ
Main.java (loads & parses)
โ
Dashboard (navigation hub)
โโ Start Quiz Flow
โ โโ StartQuiz (intro)
โ โโ MainWindow (quiz interface)
โ โโ ResultsWindow (results & grading)
โ
โโ Manage Questions
โโ View all questions
โโ Add new question
โโ Delete question
Material Design 2019 Color Palette:
| Element | Color Code | Purpose |
|---|---|---|
| Primary Gradient | RGB(25,118,210) โ RGB(13,71,161) | Main UI background |
| Success Action | RGB(76,175,80) | Start, Save, Retake buttons |
| Secondary Action | RGB(33,150,243) | Navigation buttons |
| Destructive Action | RGB(244,67,54) | Quit, Delete, Cancel buttons |
| Accent | RGB(156,39,176) | Dashboard highlights |
| Highlight | RGB(255,193,7) | Percentage display |
Typography: Segoe UI font family for clean, modern appearance
quiz-master-java/
โโโ Main.java # Entry point (question loading)
โโโ Dashboard.java # Main navigation hub
โโโ StartQuiz.java # Quiz introduction screen
โโโ MainWindow.java # Interactive quiz interface
โโโ ResultsWindow.java # Results & grading display
โโโ QuestionManager.java # Question CRUD operations
โโโ Questions.java # Question data model
โโโ questions.txt # Question database
โโโ .gitignore # Git configuration
โโโ LICENSE # MIT License
โโโ README.md # This file
Institution: United International University (UIU)
Course: Object-Oriented Programming Lab
OOP Concepts Demonstrated:
- โ Object-oriented design principles
- โ GUI development with Swing
- โ Event-driven programming
- โ File I/O and data persistence
- โ Input validation and error handling
- โ Component-based architecture
- โ Real-time data processing
- User authentication and profiles
- Quiz categories and difficulty levels
- Question shuffling and randomization
- Timer-based quizzes with countdown
- Quiz history and performance analytics
- Database integration (MySQL/SQLite)
- PDF report generation
- Dark mode theme
- Sound effects and animations
- Multiplayer/competitive mode
Test Checklist:
- Question Management
โ Add 5-10 test questions
โ Verify unique question validation
โ Test deletion functionality
โ Confirm persistence after restart
- Quiz Taking
โ Take full quiz
โ Verify progress bar updates
โ Check real-time scoring
โ Validate final results
- Grading System
โ Test each grade tier (A+, A, B, C, F)
โ Verify percentage calculations
โ Confirm retake functionality
Problem: "Exception in thread 'main'"
- Solution: Ensure all Java files are compiled:
javac *.java
Problem: Questions not saving
- Solution: Verify
questions.txtis in the same directory as.classfiles
Problem: Compilation errors
- Solution: Check Java version:
javac -version(must be 8+)
Problem: GUI doesn't display (Linux)
- Solution: Set display variable:
export DISPLAY=:0
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Make your changes with clear commit messages
- Test thoroughly
- Submit a pull request with detailed description
Ideas for Contributions:
- Add user authentication system
- Implement quiz categories
- Create timer functionality
- Add database support
- Improve UI/UX design
- Write unit tests
This project is licensed under the MIT License - see the LICENSE file for details.
Sadid Ahmed
โญ If you find this project useful, please consider giving it a star!
Made with โค๏ธ for academic excellence