This Java Spring Boot Quiz App provides functionality to generate questions, create quizzes, and obtain quiz results. The backend of the application is built using Spring Boot, and PostgreSQL is used as the database.
Endpoint: http:https://localhost:8080/question/allQuestions
Description: Retrieve all questions stored in the database.
Endpoint: http:https://localhost:8080/question/getQuestion/{category}
Description: Retrieve a question based on the specified category. Replace {category}
with the desired category (e.g., React.js
).
Endpoint: http:https://localhost:8080/quiz/get/{quizId}
Description: Retrieve details of a quiz based on its ID.
Endpoint: http:https://localhost:8080/question/add
Description: Add a new question to the database.
Request Body:
{
"questionText": "What is the purpose of the 'try', 'catch', and 'finally' blocks in Java?",
"option_a": "To handle exceptions in code",
"option_b": "To define loop structures",
"option_c": "To declare variables",
"correctAnswer": "To handle exceptions in code",
"category": "Java",
"difficultyLevel": "Medium"
}
Endpoint: http:https://localhost:8080/quiz/create
Description: Create a new quiz by specifying the category, number of questions, and title.
Parameters:
category
: Category for the quiz (e.g.,React.js
)numQ
: Number of questions in the quiztitle
: Title of the quiz
Endpoint: http:https://localhost:8080/quiz/submit/{quizId}
Description: Submit a quiz and obtain the results.
Request Body:
[
{
"id": 78,
"response": "A programming language"
},
{
"id": 79,
"response": "A programming language"
}
]
- Clone the repository
- Configure PostgreSQL database connection in
application.properties
file. - Run the application:
./mvnw spring-boot:run
- Spring Boot
- PostgreSQL
- Spring Data JPA