Skip to main content

Get contest attempt answer breakdown (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/contests/:contestId/attempts/:attemptId/answers

Description

Returns per-question detail for a single submitted attempt: question text, the option the participant selected, the correct option label, and whether the answer was correct. Questions are listed in the order shown to the participant.

Authentication

Required: Workspace token. Persona: Workspace Owner (same as other workspace contest routes). Staff do not have access to the contests section.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <workspace token>
Content-TypeNo

Path parameters

NameTypeRequiredDescription
workspaceIdstringYesWorkspace id
contestIdstringYesContest id
attemptIdstringYesContest attempt document id (from list results or owner leaderboard)

Response 200 OK

{
"items": [
{
"questionId": "...",
"questionText": "نص السؤال",
"selectedOptionId": "opt_a",
"selectedOptionLabel": "خيار اختاره المتسابق",
"correctOptionId": "opt_b",
"correctOptionLabel": "الإجابة الصحيحة",
"isCorrect": false
}
]
}

If the participant did not answer a question, selectedOptionId and selectedOptionLabel are null and isCorrect is false.

Common Errors

  • 400 Bad Request: Invalid attemptId format
  • 401 Unauthorized: Missing or invalid token
  • 403 Forbidden: Token not allowed for this workspace
  • 404 Not Found: Contest not in workspace, or attempt not found / not submitted / wrong contest
  • 500 Internal Server Error