Skip to content

Submit All Answers (Anonymous User)

Submit all quiz answers at once for an anonymous user.


Overview

This endpoint allows submitting all answers to a quiz in a single request for an anonymous user. It marks the quiz as completed and returns the updated answer object.

Method: POST
Endpoint:
/api/v1/namespaces/:namespaceId/quizzes/:quizId/users/anonymous/answers/submit

Quiz must support anonymous participation.


Request

Path Parameters

ParameterTypeRequiredDescription
namespaceIdstringNamespace unique ID
quizIdstringQuiz unique ID

Body

json
{
  "anonymousUserId": "anon_12345",
  "answers": {
    "question1": {
      "type": "text",
      "value": "Answer content"
    },
    "question2": {
      "type": "multiple_choice",
      "value": "Option B"
    }
  },
  "language": "en"
}

Body Parameters

FieldTypeRequiredDescription
anonymousUserIdstringAnonymous user identifier
answersobjectObject mapping question IDs to answer objects
languagestringOptional language code

Response

json
{
  "answers": {
    "id": "quiz1234-anon_12345",
    "userId": "anon_12345",
    "quizId": "quiz1234",
    "qAnswers": { ... },
    "completionStatus": 3,
    "isAnonymous": true
  },
  "anonymousUserId": "anon_12345"
}

Error Responses

  • 500 Internal Server Error – If the quiz does not exist
json
{
  "error": "quiz does not exist"
}

Other possible errors:

  • Quiz not found
  • Namespace not found