Assignment Attempt
Submits a student's assignment: an uploaded file and/or a comment. Put the assignment's exercise ID in the URL. The submission waits for a tutor to grade it with "Evaluate Assignment and Update Marks". The same endpoint takes test answers; see "Push Attempted Exercise Payload".
/exercises/{exercise_id}/attemptcurl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/exercises/{exercise_id}/attempt' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--form 'file_1=' \
--form 'JSONString={"test_id":0,"section_id":169940,"exercise_id":73182,"exercise_name":"asfdcasdf","class_id":"135638","user_test_time":0,"student_comments":"Submission Addtional Comments"}'{
"code": 200,
"message": "success",
"attempt_id": 15056317,
"is_exam_certificate_applicable": false
}Access: Students (and admins). For students the exercise must be available to them in the class.
Request body: form-data with a JSONString field holding the JSON below. For assignments, also send the submission as a file field.
is_quiz is true.JSONString1 final submission (default). 0 saves answers without submitting.true when the path ID is a quiz.Structure of test_parts: an array of parts, each {"test_part_id": ..., "questions": [...]}. Each question is {"question_id": ..., "user_answers": [{"answer": [...], "user_question_time": seconds}], "user_question_time": seconds}. answer holds the chosen option indexes (as strings) or the typed answer.
Notes:
- Errors: "Max test attempts over" or "Maximum allowed submissions limit reached!" when attempts are used up; "Submission closed. Assignment due date has passed." when the due date has passed and late submission isn't allowed; "Param [test_parts] required" for a test submission without answers; "Attempt not submitted yet" (with the open
attempt_id) for proctored exams with an unsubmitted attempt. - Submissions send an "exercise submitted" webhook if your institute has one. Assignments with AI evaluation turned on are queued for AI grading.
- Rate limit: 30 requests per minute; going over locks you out for 30 minutes.