Skip to main content
PATCH
cURL
Step 6 of 8 in Evaluate an exam. One call can change several things at once.

Rules

  • The body is a JSON array, even for a single change. Every item needs entity and id.
  • Every item is validated before anything is saved. One bad item rejects the whole call with 400.
  • The id must belong to the exam in the path.
  • An answer item that changes text or marks must include updateReason. It comes back as teacherFeedback.
  • When an item changes marks or maxQuestionAttempt, the totals above it are recalculated for you: the question group, then the section, then the exam.

What you can edit

Editing a question, a parentQuestion, or a modelAnswer stops working as soon as any answer sheet for the exam has been submitted. You then get 400 Cannot modify question/model answer after evaluation of student answer sheets. Fix the paper and the answer key before the first sheet goes in.
answer and section edits keep working after evaluation, so a teacher can still change a student’s marks. An answer’s marks are only checked for being negative, not against the question’s marks, so validate that in your own interface.
Changing a modelAnswer’s stepMarking does not change the question’s marks, so isModelAnswerMarkMismatch can turn true. Send a question item with the new marks in the same call to keep them in step.
Editing a question or a model answer also sends the change to the AI, so later answer sheets are graded against the corrected version. Already graded sheets keep the marks they have.

Next step

Publish exam results

Let students read their scores.

Authorizations

Authorization
string
header
required

Access token from Get an access token. A missing, invalid, or expired token returns 403.

Path Parameters

examId
string<uuid>
required

The exam id returned by Create an exam.

Example:

"d19e6868-98dd-4274-a2a5-4a616dd93ea7"

Body

application/json
Minimum array length: 1
entity
enum<string>
required

What you are editing.

Available options:
question,
parentQuestion,
modelAnswer,
answer,
section
id
string<uuid>
required

The entity's id, which must belong to this exam.

text
string

New text. For modelAnswer it is the answer text, and for answer it is what the student wrote. Not used by section.

marks
number<float>

New marks. For parentQuestion and section it cannot exceed the total of the level below.

Required range: x >= 0
maxQuestionAttempt
integer | null

For parentQuestion and section only: how many of the items below count toward the score. Cannot exceed how many exist.

Required range: x >= 0
isApproved
boolean

Mark the item as reviewed by a teacher.

stepMarking
object[]

For modelAnswer only: the new step by step marking.

updateReason
string

Why the answer changed. Required when an answer item sends text or marks. It comes back as teacherFeedback.

diagram_description
string

For question and answer: a new diagram description. This field keeps its snake_case name.

Response

Every item was saved. Marks on question groups, sections, and the exam are recalculated, and the changes are sent to the AI so later evaluations use them.

status
string
Example:

"Success"

message
string