It can store quizzes to be solved. Users can also post their quizzes.
Spring Boot
Spring Security
Spring Data
Project Lombok
H2 database
POST api/user/register
{
"email": "<email>",
"password": "<password>"
}POST api/user/authenticate
{
"email": "<email>",
"password": "<password>"
}If correct, returns 200 OK code. If not - 401 UNAUTHORIZED
GET api/quizzes/{id}
| Parameter | Type | Description |
|---|---|---|
id |
@path |
Required. Quiz id |
Returns one quiz
GET api/quizzes
| Parameter | Type | Description |
|---|---|---|
page |
int |
Not required. Id of a page to fetch (Default = 0) |
Returns page with only 10 quizzes.
GET api/quizzes/completed
| Parameter | Type | Description |
|---|---|---|
page |
int |
Not required. Id of a page to fetch (Default = 0) |
Returns page with only 10 completed quizzes by an authenticated user.
POST api/quizzes/{id}/solve
| Parameter | Type | Description |
|---|---|---|
id |
@path |
Required. Id of a quiz |
{
"answer": ["<list of the correct answers>"]
}Checks answer. If correct saves it to db.
POST api/quizzes
{
"title": "<title>",
"text": "<text>",
"options": "<more than 2 (Example: 1, 2)>",
"answer": "<correct options>"
}Saves a new quiz to db.
DELETE api/quizzes/{id}
| Parameter | Type | Description |
|---|---|---|
id |
@path |
Required. Id of a quiz to delete |
Delets a quiz, posted by authenticated user.
PATCH api/quizzes/{id}
| Parameter | Type | Description |
|---|---|---|
id |
@path |
Required. Id of a quiz to update |
Should contain at least one of these properties:
{
"title": "<title>",
"text": "<text>",
"options": "<more than 2 (Example: 1, 2)>",
"answer": "<correct options>"
}Updates the quiz with specified id.
- Java 11 or higher
- Go to project directory
cd my-project- Execute gradle tasks
./gradlew clean
./gradlew bootJar- Jar file will be located in the /build/libs folder
- Go to the project directory
cd /build/libs- Start the application
java -jar web_quiz_engine-1.2.jar