Online Quiz Application
A Java Swing-based quiz application that allows users to take multiple-choice quizzes, track scores, and view a leaderboard. Questions and scores are saved locally in text files.
π Features
User-friendly Java Swing GUI
Supports multiple-choice questions with 4 options each
Timer-based quiz with visual countdown and color-coded alerts
Displays score, grade, and time taken after quiz completion
Leaderboard showing top 10 players
Persistent storage of questions (questions.dat) and scores (scores.dat)
Shuffle questions for randomness
Option to retake the quiz after completion
π» Getting Started Prerequisites
Java JDK 8 or higher
IDE or editor (VS Code, IntelliJ IDEA, Eclipse)
Basic knowledge of running Java Swing applications
Clone the Repository git clone https://github.com/IneshAg/Employee-Payroll-System.git cd Employee-Payroll-System
Compile and Run Using Terminal: javac -d bin Quiz/OnlineQuizApplication.java java -cp bin Quiz.OnlineQuizApplication
Using IDE:
Open the project in your IDE.
Compile and run OnlineQuizApplication.java.
π Project Structure Employee-Payroll-System/ ββ Quiz/ β ββ OnlineQuizApplication.java # Main quiz application β ββ questions.dat # Stores quiz questions ββ EmployeePayrollSystem.java # Another project in the repo ββ scores.dat # Stores player scores ββ README.md
βοΈ How It Works
On launch, the user is prompted to enter their name.
Questions are loaded from questions.dat; if not present, sample questions are created.
Questions are displayed one at a time with 4 options.
Timer counts down from 5 minutes; colors indicate urgency.
User selects an answer and clicks Next.
On the last question, Submit Quiz calculates the score and shows results.
Results include score, percentage, grade, and time taken.
Leaderboard displays top 10 scores sorted descendingly.
Scores are saved in scores.dat for persistence.
π― Key Classes
OnlineQuizApplication β Main class handling GUI, quiz logic, and timer
Question β Represents a quiz question with options and correct answer
Score β Represents a playerβs score, total questions, and date
π Features to Improve (Future)
Add categories and difficulty levels for questions
Integrate database support instead of .dat files
Add images or multimedia questions
Implement user authentication
This project is open-source and free to use for educational purposes.

