Web-Quiz-Engine

A simple engine for creating and solving quizzes through HTTP API.

H2 database was used to store all the data.

Desription

API supports creating, getting, solving and deleting quizzes. Each quiz is described by id, title, text and array of correct answers. Answer is not visible in the API.

To perform any actions with quizzes user have to be registrated and then authorized via HTTP Basic Auth. Otherwise, the service returns the HTTP 401 (Unauthorized) code.

Examples

Register new user

POST: /api/register

Create new quiz

POST: /api/quizzes

Get quiz by id

GET: /api/quizzes/{id}

Solve a quiz

GET: /api/quizzes/{id}/solve

Delete quiz by id

Deleting quiz is only possible for user that created it.

DELETE: /api/quizzes/{id}

Get all quizzes with paging

GET: /api/quizzes

Default value is 10 quizzes per page, starting from first page, sorted by id.

For getting 5 quizzes per page, page 2:

GET: /api/quizzes?size=5&page=1

Get all completions of quizzes with paging

Shows all completions of quizzes by current user. For one quiz there can be multiple completions.

GET: /api/quizzes/completed