Push Attempted Exercise Payload
Submits a student's answers to an exercise (test) and returns the marked result. Put the exercise ID in the URL. Send the answers collected after "Get Exercise Details". The same endpoint takes assignment uploads; see "Assignment Attempt".
/exercises/{ResourceId}/attemptcurl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/exercises/{ResourceId}/attempt' \
--form 'JSONString={"test_id":7847,"section_id":5688,"exercise_id":4199,"exercise_name":"EXE","test_parts":"[{\"test_part_id\":10422,\"questions\":\"[{\\\"question_id\\\":1461488,\\\"user_answers\\\":[{\\\"answer\\\":[\\\"Demo\\\"],\\\"user_question_time\\\":321}],\\\"user_question_time\\\":321},{\\\"question_id\\\":1443328,\\\"user_answers\\\":[{\\\"answer\\\":[\\\"0\\\"],\\\"user_question_time\\\":2}],\\\"user_question_time\\\":2},{\\\"question_id\\\":1443329,\\\"user_answers\\\":[{\\\"answer\\\":[\\\"1\\\"],\\\"user_question_time\\\":5}],\\\"user_question_time\\\":5},{\\\"question_id\\\":1482454,\\\"user_answers\\\":[{\\\"answer\\\":[],\\\"user_question_time\\\":9}],\\\"user_question_time\\\":9,\\\"difficulty\\\":1,\\\"engage_topic_tag_id\\\":1816},{\\\"question_id\\\":1657324,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":1,\\\"engage_topic_tag_id\\\":1816},{\\\"question_id\\\":586758,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"engage_topic_tag_id\\\":1816},{\\\"question_id\\\":1461493,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":1047058,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":179153,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"engage_topic_tag_id\\\":1816},{\\\"question_id\\\":1461487,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":669037,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":586759,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":1461491,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":1047064,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":1657323,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":1,\\\"engage_topic_tag_id\\\":1816},{\\\"question_id\\\":1461486,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":1461490,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":1461489,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0},{\\\"question_id\\\":1656750,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"engage_topic_tag_id\\\":1816}]\",\"part_user_time\":337,\"max_questions_allowed\":0}]","class_id":39946,"user_test_time":337}'{
"code": 200,
"message": "The Exercise has been evaluated !",
"result": {
"test_id": 7847,
"section_id": 5688,
"exercise_id": 4199,
"exercise_name": "EXE",
"test_parts": "[{\"test_part_id\":10422,\"questions\":\"[{\\\"question_id\\\":1461488,\\\"user_answers\\\":[{\\\"answer\\\":[\\\"Demo\\\"],\\\"user_question_time\\\":321}],\\\"user_question_time\\\":321,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":1,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1443328,\\\"user_answers\\\":[{\\\"answer\\\":[\\\"0\\\"],\\\"user_question_time\\\":2}],\\\"user_question_time\\\":2,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":-1,\\\"is_attempted\\\":1,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1443329,\\\"user_answers\\\":[{\\\"answer\\\":[\\\"1\\\"],\\\"user_question_time\\\":5}],\\\"user_question_time\\\":5,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":1,\\\"marks\\\":1,\\\"is_attempted\\\":1,\\\"exp\\\":100,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1482454,\\\"user_answers\\\":[{\\\"answer\\\":[],\\\"user_question_time\\\":9}],\\\"user_question_time\\\":9,\\\"difficulty\\\":1,\\\"engage_topic_tag_id\\\":1816,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1657324,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":1,\\\"engage_topic_tag_id\\\":1816,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":586758,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"engage_topic_tag_id\\\":1816,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":0}]},{\\\"question_id\\\":1461493,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1047058,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":179153,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"engage_topic_tag_id\\\":1816,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1461487,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":669037,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":586759,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":0}]},{\\\"question_id\\\":1461491,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1047064,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1657323,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":1,\\\"engage_topic_tag_id\\\":1816,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1461486,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1461490,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":0}]},{\\\"question_id\\\":1461489,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]},{\\\"question_id\\\":1656750,\\\"user_answers\\\":[{\\\"answer\\\":[]}],\\\"user_question_time\\\":0,\\\"difficulty\\\":2,\\\"engage_topic_tag_id\\\":1816,\\\"markedInputs\\\":[{\\\"correct\\\":0,\\\"marks\\\":0,\\\"is_attempted\\\":0,\\\"exp\\\":0,\\\"isFinalized\\\":1}]}]\",\"part_user_time\":337,\"max_questions_allowed\":0,\"part_userMark\":0,\"part_userExp\":100,\"part_totalMark\":24,\"part_total_inputs\":19,\"part_correct_inputs\":1,\"part_attempted\":3,\"part_wrong_inputs\":2,\"part_skipped\":16}]",
"class_id": 39946,
"user_test_time": 337,
"test_userMark": 0,
"test_userExp": 100,
"test_totalMark": 24,
"grade": 0,
"perfect": 0,
"passed": 0,
"test_parts_array": [
{
"test_part_id": 10422,
"questions": "[{\"question_id\":1461488,\"user_answers\":[{\"answer\":[\"Demo\"],\"user_question_time\":321}],\"user_question_time\":321,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":1,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1443328,\"user_answers\":[{\"answer\":[\"0\"],\"user_question_time\":2}],\"user_question_time\":2,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":-1,\"is_attempted\":1,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1443329,\"user_answers\":[{\"answer\":[\"1\"],\"user_question_time\":5}],\"user_question_time\":5,\"difficulty\":2,\"markedInputs\":[{\"correct\":1,\"marks\":1,\"is_attempted\":1,\"exp\":100,\"isFinalized\":1}]},{\"question_id\":1482454,\"user_answers\":[{\"answer\":[],\"user_question_time\":9}],\"user_question_time\":9,\"difficulty\":1,\"engage_topic_tag_id\":1816,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1657324,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":1,\"engage_topic_tag_id\":1816,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":586758,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"engage_topic_tag_id\":1816,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":0}]},{\"question_id\":1461493,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1047058,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":179153,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"engage_topic_tag_id\":1816,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1461487,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":669037,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":586759,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":0}]},{\"question_id\":1461491,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1047064,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1657323,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":1,\"engage_topic_tag_id\":1816,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1461486,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1461490,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":0}]},{\"question_id\":1461489,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]},{\"question_id\":1656750,\"user_answers\":[{\"answer\":[]}],\"user_question_time\":0,\"difficulty\":2,\"engage_topic_tag_id\":1816,\"markedInputs\":[{\"correct\":0,\"marks\":0,\"is_attempted\":0,\"exp\":0,\"isFinalized\":1}]}]",
"part_user_time": 337,
"max_questions_allowed": 0,
"part_userMark": 0,
"part_userExp": 100,
"part_totalMark": 24,
"part_total_inputs": 19,
"part_correct_inputs": 1,
"part_attempted": 3,
"part_wrong_inputs": 2,
"part_skipped": 16
}
],
"points": 0,
"total_inputs": 19,
"total_correct_inputs": 1,
"test_time": 0,
"total_attempted": 3,
"total_wrong_inputs": 2,
"total_skipped": 16,
"accuracy": 33.33,
"isFinalized": 0,
"user_submission": "",
"correct_answer_time": 5,
"incorrect_answer_time": 323,
"low_difficulty_question": 0,
"medium_difficulty_question": 1,
"high_difficulty_questison": 0,
"total_low_difficulty_question": 3,
"total_medium_difficulty_question": 16,
"total_high_difficulty_questison": 0,
"attempted_low_difficulty_question": 0,
"attempted_medium_difficulty_question": 3,
"attempted_high_difficulty_questison": 0,
"low_difficulty_percentage": 0,
"medium_difficulty_percentage": 18.75,
"high_difficulty_percentage": 0,
"low_difficulty_accuracy": 0,
"medium_difficulty_accuracy": 33.33,
"high_difficulty_accuracy": 0,
"user_topic_marks": {
"1816": 0
},
"total_topic_marks": {
"1816": 24
},
"user_topic_time_taken": {
"1816": 337
},
"total_topics": [
1816
],
"user_topic_subjects": {
"1816": 684
},
"user_topic_score": {
"1816": 0
},
"user_topic_subject_score": {
"1816": 0
},
"user_topic_subject_mark": {
"1816": 0
},
"user_topic_subject_total_mark": {
"1816": 24
},
"total_topic_question": {
"1816": 19
},
"total_attempted_topic_question": {
"1816": 3
},
"total_attempted_subject_question": {
"1816": 3
},
"total_subject_question": {
"1816": 19
},
"total_correct_attempted_topic_question": {
"1816": 1
},
"total_correct_attempted_subject_question": {
"1816": 1
},
"grade_range": "B++",
"isExercise": 1,
"attempt_id": 6527855,
"results_declared": 1,
"is_psycological": 0
}
}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.
200The Exercise has been evaluated !Show child attributesHide child attributes
784756884199EXE39946337010024000Show child attributesHide child attributes
104223370010024191321601910321633.33053230103160030018.750033.330Show child attributesHide child attributes
0Show child attributesHide child attributes
24Show child attributesHide child attributes
337Show child attributesHide child attributes
684Show child attributesHide child attributes
0Show child attributesHide child attributes
0Show child attributesHide child attributes
0Show child attributesHide child attributes
24Show child attributesHide child attributes
19Show child attributesHide child attributes
3Show child attributesHide child attributes
3Show child attributesHide child attributes
19Show child attributesHide child attributes
1Show child attributesHide child attributes
1B++1652785510Notes:
- 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.