This is a Java-based Quiz System application that allows administrators to manage questions and students to take quizzes.
- User Authentication: Users can log in with their username and password. The system supports two roles: administrators and students.
- Admin Question Management: Administrators can add new multiple-choice questions to the quiz.
- Student Quiz Taking: Students can take quizzes consisting of randomly selected questions. The system calculates and displays the student's score.
- Data Storage: User and quiz data are stored in JSON files (
users.jsonandquiz.json).
- Java
- json-simple library for JSON processing
- Java Development Kit (JDK) 8 or later
- IntelliJ IDEA (or your preferred Java IDE)
- Gradle (if you want to use the provided Gradle build)
-
Clone the repository:
git clone <repository_url> cd <repository_name>
-
Open the project in IntelliJ IDEA:
- Open IntelliJ IDEA.
- Select "Open or Import Project."
- Navigate to the project directory and select the
build.gradlefile (if you are using Gradle) or the project directory itself. - IntelliJ IDEA will import the project.
-
Add the
json-simplelibrary (if not using Gradle):- If you're not using Gradle, you'll need to manually add the
json-simplelibrary to your project. - Download the
json-simpleJAR file from https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple/1.1.1 - In IntelliJ IDEA, go to "File" -> "Project Structure" -> "Modules" -> "Dependencies".
- Click the "+" button and select "JARs or directories".
- Add the downloaded JAR file.
- If you're not using Gradle, you'll need to manually add the
-
Configure the JSON file paths:
- Ensure that the
users.jsonandquiz.jsonfiles are located in thedata/directory. - The file paths are defined relative to the project's root directory.
- Ensure that the
-
Build the project:
- Using IntelliJ IDEA: Go to "Build" -> "Build Project".
- Using Gradle: Run the command
gradle buildin the terminal.
-
Run the application:
- Using IntelliJ IDEA: Open the
Main.javafile and run themainmethod. - Using Gradle: Run the command
gradle runin the terminal.
- Using IntelliJ IDEA: Open the
model/: Contains classes that represent the data entities (User,Question).controller/: Contains classes that handle the application's logic (Admin,Student).util/: Contains utility classes, such asJsonHandlerfor handling JSON file operations.Main.java: The entry point of the application.data/: Directory containing the JSON files for user and quiz data.
- Login:
- The application prompts for a username and password.
- Use the following default credentials:
- Admin: username = "admin", password = "1234"
- Student: username = "mahbub", password = "1234" (You can add more users to the
users.jsonfile)
- Admin Functionality:
- After logging in as an admin, you can add questions to the quiz.
- Follow the prompts to enter the question, options, and answer key.
- Student Functionality:
- After logging in as a student, you can start the quiz.
- The application will present questions, and you can enter your answers.
- Your score will be displayed at the end of the quiz.
- Implement saving quiz results.
- Introduce difficulty levels for questions.
- Implement a timer for the quiz.
- Develop a graphical user interface (GUI).
Mahbubur Rahman
This project is not licensed...yet!
