A simple Java-based command-line quiz application where users can log in as either admin or student.
- Admins can add new multiple-choice questions to a quiz bank.
- Students can take a 10-question quiz generated randomly from the question bank.
All user and question data is managed using JSON files.
- Java (version 17)
- Gradle (build system)
- JSON.simple (for handling JSON files)
- IntelliJ IDEA (IDE)
- User login system using
users.json
- Admin role can:
- Add new quiz questions
- Input 4 options and specify the correct answer
- Student role can:
- Take a 10-question quiz with randomized questions
- Get instant score feedback
- Retry the quiz if desired
- Data is stored in:
users.json
for user credentials and rolesquizBank.json
for quiz questions
Follow these steps to set up and run the project locally on your machine.
git clone https://github.com/ShababAhmedd/JavaQuizSystem.git
cd JavaQuizSystem
- Launch IntelliJ IDEA.
- Go to File > Open.
- Select the root folder of the cloned project (
JavaQuizSystem
) and open it.
- Navigate to File > Project Structure > Project.
- Set Project SDK to Oracle OpenJDK 17.0.12 (or add it manually if not available).
- Ensure the Project language level is set to 17.\
- This project uses Gradle as the build system with the Groovy DSL.
- Ensure the build.gradle file is present and properly configured.
- Open the
build.gradle
file and confirm the following dependency exists under dependencies:
dependencies {
// https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple
implementation("com.googlecode.json-simple:json-simple:1.1.1")
}
- Open the Gradle tab on the right sidebar of IntelliJ IDEA.
- Click the Reload All Gradle Projects button (🔄) to sync dependencies.
- Alternatively, use Build > Reload Project from the top menu.
- Navigate to the file:
src/main/java/JavaQuizSystem/JavaQuizSystem.java
. - Right-click on the file and select Run 'JavaQuizSystem.main()'.
- Follow the on-screen instructions to use the quiz system.