The scores endpoints handle quiz submission and results. When a user submits a quiz, the server evaluates each answer against the stored correct options and returns a score. Users can retrieve their own attempt history and aggregate statistics. Admin users have access to scores across all users and quizzes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/geeky-hamster/Quizmaster/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/scores/submit
Submit answers for a completed quiz. The server computes the score by comparing eachselected_option against the stored correct_option for the question. Requires a valid bearer token.
ID of the quiz being submitted.
Array of answer objects, one per question.
Time spent on the quiz as a string (e.g.
"18:42").Confirmation message:
Quiz submitted successfully.Score expressed as a percentage (0–100).
| Status | Message |
|---|---|
| 400 | No questions found for this quiz |
| 404 | Quiz not found |
cURL
GET /api/scores/user
Retrieve all quiz attempts for the currently authenticated user, ordered by most recent first. Requires a valid bearer token. No request body. Response — 200 OK Returns an array of score objects, each including a nestedquiz object. Items are ordered descending by time_stamp_of_attempt.
Score record ID.
Quiz ID.
User ID.
Attempt timestamp.
Total questions in the quiz.
Correct answers.
Time taken.
The associated quiz object.
cURL
GET /api/scores/user/stats
Retrieve aggregate performance statistics for the currently authenticated user. Requires a valid bearer token. No request body. Response fields — 200 OKTotal number of quizzes the user has attempted.
Total number of questions answered across all attempts.
Total number of correct answers across all attempts.
Average score expressed as a percentage (0–100).
cURL
GET /api/scores/quiz/:quizId
List all scores for a specific quiz, including user details. Requires a valid bearer token with admin role.The ID of the quiz whose scores to retrieve.
user object with basic identity fields.
Score record ID.
Quiz ID.
User ID.
Attempt timestamp.
Total questions.
Correct answers.
Time taken.
cURL
GET /api/scores
List all scores across every quiz and user. Requires a valid bearer token with admin role. No request body. Response — 200 OK Returns an array of score objects, each including nestedquiz and user objects.
cURL