A Java-based console application for creating, managing, and taking quizzes. Designed for extensibility and ease of use, it supports question management, quiz sessions, and persistent storage of questions in JSON format.
- Console-based interactive UI
- Add, view, and manage quiz questions
- Take quizzes with questions loaded from a JSON file
- Questions categorized by difficulty
- Modular service-based architecture
- Configurable question source and caching
- Logging and error handling
src/main/java/org/pure/java/project/— Main application source codeMain.java— Application entry pointui/ConsoleUI.java— Console user interface logicservice/— Core services (QuizService, QuestionService, QuestionLoaderService)model/— Data transfer objects, entities, enums, and result typesrepository/— Data access layerconfig/— Application configuration and context
src/main/resources/application.properties— Configuration fileQuestion.json— Sample questions in JSON format
build.gradle— Gradle build configuration
- Java 17 or higher
- Gradle (or use the provided
gradlewwrapper)
- Clone the repository:
git clone <repo-url> cd QuizApplication
- Build the project:
./gradlew build
- Run the application:
Or run the
./gradlew run
Mainclass from your IDE.
- Edit
src/main/resources/application.propertiesto set the path to your questions file and enable/disable caching:questions.file.path=src/main/resources/Question.json question.cache.enable=true
- On startup, the application presents a main menu in the console.
- You can add new questions, start a quiz, or view/manage existing questions.
- Questions are loaded from the configured JSON file and can be filtered by difficulty.
{
"id": 1,
"question": "What is 1 + 1?",
"answers": ["1", "2", "3", "4"],
"correctIndex": 1,
"difficulty": "EASY"
}- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes
- Push to your branch (
git push origin feature/your-feature) - Open a pull request
- Follow standard Java code conventions
- Write clear commit messages
- Add tests for new features where possible
This project is licensed under the MIT License.
Artyom Aroyan
Feel free to open issues or submit pull requests for improvements!