Grade an assignment submission.

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Grades a learner's assignment submission with a score and feedback, or asks for a resubmission. Sending score sets submissionStatus to 3 (Graded).

Endpoint

put https://{TrainerCentral-API-Domain}/tc/api/v1/trainer/session/{sessionId}/assignmentSubmissions/{assignmentSubmissionId}.json

OAuth Scope

TrainerCentral.sessionapi.UPDATECopied!

Headers

tc-orgIdstring(Required)

ID of the academy (orgId).

Example
51517414

Path Parameters

sessionIdstring(Required)

ID of the assignment lesson (sessionId).

assignmentSubmissionIdstring(Required)

ID of the learner submission.

Request Body

application/json
assignmentSubmissionJSON Object(Required)

Grade and other changes; send only the keys to change.

Hide Sub-Attributes
scoredouble(Optional)

Score from 0 to the total points of the assignment. Sets submissionStatus to 3 (Graded).

feedbackstring(Optional)

Trainer feedback for the learner. Supports rich text.

submissionStatusinteger(Optional)

Status to set. Allowed: 3=Graded, 2=Ask the learner to resubmit.

extendedDeadlinelong(Optional)

New submission deadline for this learner, in epoch milliseconds.

maxAllowedSubmissionsinteger(Optional)

Number of submissions this learner may make (0-10).

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request PUT \
  --url https://trainercentral.zoho.com/tc/api/v1/trainer/session/{sessionId}/assignmentSubmissions/{assignmentSubmissionId}.json \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/json' \
  --header 'tc-orgId: 51517414' \
  --data '{"assignmentSubmission":{"score":90,"feedback":"<p>Great work. Watch the edge cases.</p>"}}'

Body Parameters

Give 90 points with feedback.

Give 90 points with feedback.

Ask for a resubmission.

Copied!
  {
    "assignmentSubmission": {
      "score": 90,
      "feedback": "<p>Great work. Watch the edge cases.</p>"
    }
  }
                
  {
    "assignmentSubmission": {
      "submissionStatus": 2,
      "maxAllowedSubmissions": 2,
      "feedback": "<p>Please add comments to your code.</p>"
    }
  }
                
▼ Show full

Response Parameters

assignmentSubmissionJSON Object

The submission with its latest status, score and feedback.

Hide Sub-Attributes
assignmentSubmissionIdstring

ID of the submission.

idstring

Same as assignmentSubmissionId.

sessionIdstring

ID of the assignment lesson (sessionId).

courseIdstring

ID of the course that holds the assignment.

zuidstring

User ID of the learner who submitted.

submissionStatusstring

Status of the submission. Allowed: 0=In progress, 1=Submitted, 2=Resubmission requested, 3=Graded, 4=Resubmission in progress.

scorestring

Score given by the trainer. Absent until graded.

percentagestring

Score as a percentage of totalPoints.

totalPointsstring

Total points of the assignment.

feedbackstring

Trainer feedback. Supports rich text.

isSubmissionValidstring

true when the submission is still valid for grading.

attemptsCountstring

Number of submissions the learner has made.

maxAllowedSubmissionsstring

Number of submissions the learner may make.

enableAssignmentResubmissionstring

true when resubmission is allowed for the assignment.

assignmentReSubmissionLimitstring

Maximum number of resubmissions set on the assignment.

submittedDatestring

Time of the latest submission in epoch milliseconds.

lastUpdatedTimestring

Time of the last change in epoch milliseconds.

materialsJSON Array

Files the learner submitted.

Hide Sub-Attributes
JSON Object
Show Sub-Attributes
assignmentSubmissionstring

ID of the assignment submission.

materialIdstring

ID of the material.

materialTypeinteger

Type of material.

linkAddressstring

URL of the material.

kindinteger

Kind of material.

extensionstring

File extension, for example pdf.

sizeinteger

File size in bytes.

statusinteger

Status of the material.

categorystring

Category of the material.

errorJSON Object

Error details.

Hide Sub-Attributes
codestring

Deprecated numeric error code (for example ST_202). Prefer codeStr; omitted from doc samples.

codeStrstring

Error code name (ShowtimeErrorCode / err_code_str), for example MISSING_PARAMETER.

messagestring

Error message.

Possible Error Codes

HTTP CodeError CodeDescription
500ST_79

INVALID_SESSION - The sessionId does not match a session in this academy. Pass a valid sessionId. Do not retry unchanged.

ST_401

SESSION_DELETED - The session was deleted. Use a session that is not deleted. Do not retry unchanged.

ST_102

UNAUTHORISED_ACCESS - The user is not an academy owner or admin, a trainer of the assignment, or a course admin or trainer. Call with one of these roles; do not retry unchanged.

Response Example

Response after grading a submission.

200
200
400
500
Copied!
  {
    "assignmentSubmission": {
      "assignmentSubmissionId": "3000000000100",
      "id": "3000000000100",
      "sessionId": "3000000000048",
      "courseId": "3000000000022",
      "zuid": "51456950",
      "submissionStatus": "3",
      "score": "90.0",
      "percentage": "90.0",
      "totalPoints": "100",
      "feedback": "<p>Great work. Watch the edge cases.</p>",
      "attemptsCount": "1",
      "maxAllowedSubmissions": "1",
      "submittedDate": "1782727600000",
      "lastUpdatedTime": "1782727715513"
    },
    "materials": []
  }
                
  {
    "error": {
      "code": "string",
      "codeStr": "string",
      "message": "string"
    }
  }
                
500 Request failed; see the error code.
▼ Show full

Rate Limits

Duration1 minute
Threshold20
Lock Period5 minutes

Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.