Skip to content

Interactive quiz application with Material Design UI. Create and manage quizzes through an intuitive GUI. Built with Java Swing for OOP Lab at UIU.

License

Notifications You must be signed in to change notification settings

litch07/quiz-master-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Quiz Master

Java Swing License

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.

โœจ Features

๐ŸŽฏ Quiz Taking Experience

  • 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

๐Ÿ“ Question Management

  • 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

๐Ÿ“Š Grading System

  • 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

๐ŸŽจ Modern UI

  • 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

๐Ÿ› ๏ธ Tech Stack

Component Technology
Language Java 8+
GUI Framework Swing
Storage Text file (questions.txt)
Architecture Component-based (MVC-like)
Dependencies None (Pure Java)

๐Ÿ“‹ Prerequisites

  • Java Development Kit (JDK): Version 8 or higher
  • Git (optional, for cloning)

๐Ÿš€ Getting Started

Installation

# 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 Main

The application will launch with a Dashboard containing four main options:

  1. Start Quiz - Begin taking a quiz
  2. Manage Questions - Add/delete questions
  3. Statistics - View quiz statistics
  4. Exit - Close the application

๐Ÿ“– User Guide

Adding Questions

  1. From the Dashboard, click "Manage Questions"
  2. Click "+ Add New Question" button
  3. Enter your question text in the text area
  4. Fill in all four multiple-choice options
  5. Select the correct answer from the dropdown menu
  6. 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

Taking a Quiz

  1. From the Dashboard, click "Start Quiz"
  2. Review the quiz information and click "Start Quiz" to begin
  3. Read each question and select your answer by clicking one of the four option buttons
  4. Click "Next Question" to proceed
  5. On the final question, the button changes to "Finish Quiz"
  6. 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

Grading Scale

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

๐Ÿ“ Question File Format

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

๐Ÿ—๏ธ Architecture

Class Structure

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

Data Flow

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

๐ŸŽจ Design System

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

๐Ÿ“‚ Project Structure

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

๐ŸŽ“ Educational Context

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

๐Ÿ”ฎ Future Enhancements

  • 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

๐Ÿงช Testing

Test Checklist:

  1. Question Management
   โœ“ Add 5-10 test questions
   โœ“ Verify unique question validation
   โœ“ Test deletion functionality
   โœ“ Confirm persistence after restart
  1. Quiz Taking
   โœ“ Take full quiz
   โœ“ Verify progress bar updates
   โœ“ Check real-time scoring
   โœ“ Validate final results
  1. Grading System
   โœ“ Test each grade tier (A+, A, B, C, F)
   โœ“ Verify percentage calculations
   โœ“ Confirm retake functionality

๐Ÿ› Troubleshooting

Problem: "Exception in thread 'main'"

  • Solution: Ensure all Java files are compiled: javac *.java

Problem: Questions not saving

  • Solution: Verify questions.txt is in the same directory as .class files

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

๐Ÿค Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Make your changes with clear commit messages
  4. Test thoroughly
  5. 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

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

Sadid Ahmed


โญ If you find this project useful, please consider giving it a star!

Made with โค๏ธ for academic excellence

About

Interactive quiz application with Material Design UI. Create and manage quizzes through an intuitive GUI. Built with Java Swing for OOP Lab at UIU.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages