Questions are the individual multiple-choice items that belong to a quiz. Each question has four options and a designated correct answer. Admin users can create, update, delete, and view questions with correct answers exposed. Regular authenticated users access a separate endpoint that omits theDocumentation 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.
correct_option field so answers are not revealed before submission.
POST /api/questions
Add a new question to a quiz. Requires a valid bearer token with admin role.ID of the quiz this question belongs to.
The full text of the question.
First answer option.
Second answer option.
Third answer option.
Fourth answer option.
The number of the correct option (1–4).
Confirmation message:
Question created successfully.cURL
GET /api/questions/quiz/:quizId
List all questions for a quiz including thecorrect_option field. Intended for admin review. Requires a valid bearer token (any authenticated user).
The ID of the quiz whose questions to retrieve.
correct_option field.
cURL
GET /api/questions/quiz/:quizId/user
List questions for a quiz without exposing correct answers. Use this endpoint when presenting questions to users taking the quiz. Requires a valid bearer token.The ID of the quiz whose questions to retrieve.
correct_option field is omitted from each item.
Always use this endpoint when rendering questions to non-admin users to prevent answer leakage.
cURL
GET /api/questions/:id
Retrieve a single question by ID. Requires a valid bearer token.The ID of the question to retrieve.
correct_option.
Errors
| Status | Message |
|---|---|
| 404 | Question not found |
cURL
PUT /api/questions/:id
Update an existing question. Requires a valid bearer token with admin role.The ID of the question to update.
Updated question text.
Updated first option.
Updated second option.
Updated third option.
Updated fourth option.
Updated correct option number (1–4).
Move this question to a different quiz by providing the new quiz ID.
Confirmation message.
Updated question object.
cURL
DELETE /api/questions/:id
Delete a question by ID. Requires a valid bearer token with admin role.The ID of the question to delete.
Confirmation message:
Question deleted successfully.cURL