Skip to content

This is a Java-based Quiz System application that allows administrators to manage questions and students to take quizzes.

raadxrahman/Java-Quiz-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quiz System Application

This is a Java-based Quiz System application that allows administrators to manage questions and students to take quizzes.

Features

  • 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.json and quiz.json).

Technologies Used

Prerequisites

  • Java Development Kit (JDK) 8 or later
  • IntelliJ IDEA (or your preferred Java IDE)
  • Gradle (if you want to use the provided Gradle build)

Setup Instructions

  1. Clone the repository:

    git clone <repository_url>
    cd <repository_name>
  2. Open the project in IntelliJ IDEA:

    • Open IntelliJ IDEA.
    • Select "Open or Import Project."
    • Navigate to the project directory and select the build.gradle file (if you are using Gradle) or the project directory itself.
    • IntelliJ IDEA will import the project.
  3. Add the json-simple library (if not using Gradle):

  4. Configure the JSON file paths:

    • Ensure that the users.json and quiz.json files are located in the data/ directory.
    • The file paths are defined relative to the project's root directory.
  5. Build the project:

    • Using IntelliJ IDEA: Go to "Build" -> "Build Project".
    • Using Gradle: Run the command gradle build in the terminal.
  6. Run the application:

    • Using IntelliJ IDEA: Open the Main.java file and run the main method.
    • Using Gradle: Run the command gradle run in the terminal.
  • 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 as JsonHandler for handling JSON file operations.
  • Main.java: The entry point of the application.
  • data/: Directory containing the JSON files for user and quiz data.

How to Use

  1. 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.json file)
  1. 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.
  1. 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.

Demonstration

Click on the video Watch the video

Future Enhancements

  • Implement saving quiz results.
  • Introduce difficulty levels for questions.
  • Implement a timer for the quiz.
  • Develop a graphical user interface (GUI).

Author

Mahbubur Rahman

License

This project is not licensed...yet!

About

This is a Java-based Quiz System application that allows administrators to manage questions and students to take quizzes.

Topics

Resources

Stars

Watchers

Forks

Languages