Get Online Exercise
Returns the settings of one exercise or assignment in a course section: timing, attempts, availability, marks, due dates and attached files. Learners also get their own progress.
GET
/exercises/{exercise_id}Get Online Exercise
curl --request GET \
--url 'https://<your-api-host>/nuSource/api/v1/exercises/{exercise_id}' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--header 'Accept: application/json, text/javascript, */*; q=0.01' \
--header 'Accept-Language: en-US,en;q=0.9,gu;q=0.8' \
--header 'Cache-Control: no-cache' \
--header 'Connection: keep-alive' \
--header 'Pragma: no-cache' \
--header 'Referer: http://localhost/app/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-origin' \
--header 'X-Requested-With: XMLHttpRequest'{
"code": 200,
"message": "Success",
"exercise": {
"exercise_id": 1026,
"test_id": 1437,
"exercise_name": "Online Exercise",
"status": "published",
"instructions": "<p>General Instructions Write Here</p>\n",
"section_id": 6174,
"test_time": 1800,
"sound_asset": null,
"sound_play_times": -1,
"availability": 1,
"activate_at": 0,
"deactivate_at": 0,
"num_of_questions": 0,
"randomize": null,
"attempts": 2,
"results_declared": 1,
"exam_type": 1,
"show_calculator": 0,
"show_compiler": 0,
"is_psycological": 0,
"is_prerequisite": 1,
"is_assignment": 0,
"max_marks": 0,
"passing_mark": 33,
"is_parts_timed": 1,
"is_parts_locked": 1,
"is_woolf_accredited": 0,
"is_partial_marking_enabled": 0,
"skip_declaration": 0,
"question_list_id": null,
"availability_msg": "",
"file_details": [],
"test_parts": [
{
"test_part_id": 1548,
"test_part_name": "Part A",
"part_time": 1800
}
]
},
"user_stats": []
}Access: Any signed-in member of the organization. Tutors must contribute to the course; learners must have access to it through a batch.
Path parameters
The exercise ID.
Query parameters
class_idinteger
Batch (class) ID. Learners should send it so availability, due dates, attempts and prerequisites are worked out for that batch.
Response
codeinteger
Example:
200messagestring
Example:
Successexerciseobject
Show child attributesHide child attributes
exercise.exercise_idinteger
Example:
1026exercise.test_idinteger
Example:
1437exercise.exercise_namestring
Example:
Online Exerciseexercise.section_idinteger
Example:
6174exercise.sound_play_timesinteger
Example:
-1exercise.availabilityinteger
1 open, 2 open until deactivate_at, 3 open between activate_at and deactivate_at, 4 closedExample:
1exercise.activate_atinteger
Example:
0exercise.deactivate_atinteger
Example:
0exercise.num_of_questionsinteger
Example:
0exercise.results_declaredinteger
Example:
1exercise.show_calculatorinteger
Example:
0exercise.show_compilerinteger
Example:
0exercise.is_psycologicalinteger
Example:
0exercise.is_prerequisiteinteger
Example:
1exercise.max_marksinteger
Example:
0exercise.passing_markinteger
Example:
33exercise.is_parts_timedinteger
Example:
1exercise.is_parts_lockedinteger
Example:
1exercise.is_woolf_accreditedinteger
Example:
0Example:
0exercise.skip_declarationinteger
Example:
0Attached files with temporary links
exercise.test_partsobject[]
Show child attributesHide child attributes
Example:
1548Example:
Part AExample:
1800user_statsarray
For learners, their progress in this batch (
times_taken, best_grade, passed, perfect, availability and due-date details, last_attempt in practice mode)Notes: For learners the call fails when a prerequisite isn't met or the content isn't released yet (drip schedule). When class_id belongs to a batch, the call records this exercise as the learner's last viewed item. Error "You do not have the permission!" when the exercise can't be loaded. Rate limit: 30 requests per minute; going over locks you out for 30 minutes.