A Java-based desktop quiz application that allows users to take quizzes, track their scores, and compete on a leaderboard. The application features a user-friendly interface and secure authentication system.
- User authentication (Login/Registration)
- Quiz selection and playing
- Real-time scoring system
- Personal results tracking
- Global leaderboard
- Clean and intuitive GUI interface
- Data persistence using MySQL database
src/
├── Main.java # Application entry point
├── dao/ # Data Access Objects
│ ├── AttemptDAO.java # Attempt data access
│ ├── QuestionDAO.java # Question data access
│ ├── QuizDAO.java # Quiz data access
│ └── UserDAO.java # User data access
├── db/ # Database related files
│ ├── insertion.sql # Sample data insertion script
│ └── schema.sql # Database schema definition
├── model/ # Data models
│ ├── Attempt.java # Attempt model
│ ├── Question.java # Question model
│ ├── Quiz.java # Quiz model
│ ├── User.java # User model
│ └── UserAnswer.java # User answer model
├── ui/ # User Interface components
│ ├── DashboardFrame.java # Main dashboard window
│ ├── LeaderboardFrame.java # Global leaderboard window
│ ├── LoginFrame.java # Login window
│ ├── Main.java # Application entry point
│ ├── QuizPlayFrame.java # Quiz playing window
│ ├── QuizSelectionFrame.java # Quiz selection window
│ ├── RegisterFrame.java # Registration window
│ └── ResultsFrame.java # User results window
└── util/ # Utility classes
└── DBConnection.java # Database connection manager
- Java Development Kit (JDK) 8 or higher
- MySQL Server 5.7 or higher
- MySQL Connector/J (JDBC driver)
- Clone the repository:
git clone https://github.com/ull0sm/QuizApp.git-
Set up the database:
- Create a MySQL database named
quiz_app - Default database credentials:
- Username: root
- Password: simp
- The database schema will be created automatically
- Create a MySQL database named
-
Build and run the application:
- Compile the Java files:
javac src/*.java src/ui/*.java src/dao/*.java src/model/*.java src/util/*.java
- Run the application:
java src.ui.Main
- Launch the application
- Login or Register a new account
- After logging in, you'll see the dashboard with options to:
- Play a Quiz: Select from available quizzes and start playing
- View Results: Check your quiz scores and performance
- View Leaderboard: See global rankings of all players
The application follows a modular architecture with:
- Java Swing for the GUI interface
- MySQL database for storing users, quizzes, and scores
- DAO pattern for database operations
- MVC-like pattern for code organization
Data flow:
- User logs in through the authentication system
- User selects a quiz from the available options
- Questions are loaded from the database
- User answers questions in real-time
- Scores are calculated and stored
- Results are displayed in the dashboard
- Scores are updated in the leaderboard
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request