PATCH /api/v1/cats/{id}/question/{question}

Updates an existing question in a CAT. Can modify question text, options, marks, or correct answers.

Path parameters

  • question string Required

    Question ID to update

  • id Required

    CAT ID (not used in logic but required for route)

application/json

Body Required

Updated question data (partial update supported)

  • question string
  • type string

    Type of question: STRUCTURED (MCQ, auto-gradable) or UNSTRUCTURED (open-ended, essay)

    Values are STRUCTURED or UNSTRUCTURED.

  • options array[string]

    Options for structured questions (MCQ). Required for STRUCTURED type, ignored for UNSTRUCTURED

  • correctAnswers array[string]

    Correct answers for auto-grading. Required for STRUCTURED type, ignored for UNSTRUCTURED

  • maxScore number

    Maximum score/marks for this question

Responses

  • 200 application/json

    Question updated successfully

  • 400

    Invalid question data

  • 403

    Insufficient permissions - requires ADMIN or LECTURER role

  • 404

    Question not found

PATCH /api/v1/cats/{id}/question/{question}
curl \
 --request PATCH 'https://api.echoplain.social/api/v1/cats/123e4567-e89b-12d3-a456-426614174000/question/456e7890-e89b-12d3-a456-426614174001' \
 --header "Content-Type: application/json" \
 --data '{"question":"string","type":"STRUCTURED","options":["string"],"correctAnswers":["string"],"maxScore":42.0}'
Request examples
{
  "question": "string",
  "type": "STRUCTURED",
  "options": [
    "string"
  ],
  "correctAnswers": [
    "string"
  ],
  "maxScore": 42.0
}
Response examples (200)
{
  "message": "Question updated successfully",
  "question": {
    "id": "456e7890-e89b-12d3-a456-426614174001",
    "type": "MULTIPLE_CHOICE",
    "marks": 3,
    "options": [
      "Paris",
      "London",
      "Berlin",
      "Madrid"
    ],
    "question": "What is the capital city of France?"
  }
}