Get Batch Class Section Resource Details (Exercise)
Returns an exercise inside a batch's course section, as a learner sees it: settings, availability and the learner's own progress in that batch. Pass the batch's `class_id`.
GET
/exercises/{ResourceId}Get Batch Class Section Resource Details (Exercise)
curl --request GET \
--url 'https://<your-api-host>/nuSource/api/v1/exercises/{ResourceId}?class_id=<ClassId>'{
"code": 200,
"message": "Success",
"exercise": {
"exercise_id": 686,
"test_id": 1066,
"exercise_name": "! only",
"status": "published",
"instructions": "<p>sa</p>\n",
"section_id": 5284,
"test_time": 0,
"sound_asset": null,
"sound_play_times": -1,
"availability": 1,
"activate_at": 0,
"deactivate_at": 0,
"num_of_questions": 7,
"randomize": 1,
"attempts": -1,
"results_declared": 1,
"exam_type": 1,
"show_calculator": 0,
"show_compiler": 0,
"is_psycological": 0,
"is_prerequisite": 0,
"is_assignment": 0,
"max_marks": 0,
"passing_mark": 25,
"is_parts_timed": 0,
"is_parts_locked": 1,
"question_list_id": 264,
"file_details": []
},
"user_stats": {
"id": 686,
"name": "! only",
"display_index": 18557,
"times_taken": "0",
"perfect": "0",
"passed": "0",
"availability": 1,
"activate_at": 0,
"deactivate_at": 0,
"best_grade": 0,
"results_declared": 1,
"exam_type": 1,
"freepreview": 0,
"is_prerequisite": 0,
"is_assignment": 0,
"is_parts_timed": 0,
"is_parts_locked": 1
}
}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:
686exercise.test_idinteger
Example:
1066exercise.exercise_namestring
Example:
! onlyexercise.section_idinteger
Example:
5284exercise.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:
7exercise.randomizeinteger
Example:
1exercise.results_declaredinteger
Example:
1exercise.show_calculatorinteger
Example:
0exercise.show_compilerinteger
Example:
0exercise.is_psycologicalinteger
Example:
0exercise.is_prerequisiteinteger
Example:
0exercise.max_marksinteger
Example:
0exercise.passing_markinteger
Example:
25exercise.is_parts_timedinteger
Example:
0exercise.is_parts_lockedinteger
Example:
1exercise.question_list_idinteger
Example:
264Attached files with temporary links
user_statsobject
For learners, their progress in this batch (
times_taken, best_grade, passed, perfect, availability and due-date details, last_attempt in practice mode)Show child attributesHide child attributes
user_stats.idinteger
Example:
686user_stats.namestring
Example:
! onlyuser_stats.display_indexinteger
Example:
18557user_stats.times_takenstring
Example:
0user_stats.perfectstring
Example:
0user_stats.passedstring
Example:
0user_stats.availabilityinteger
1 open, 2 open until deactivate_at, 3 open between activate_at and deactivate_at, 4 closedExample:
1user_stats.activate_atinteger
Example:
0user_stats.deactivate_atinteger
Example:
0user_stats.best_gradeinteger
Example:
0user_stats.results_declaredinteger
Example:
1user_stats.freepreviewinteger
Example:
0user_stats.is_prerequisiteinteger
Example:
0user_stats.is_parts_timedinteger
Example:
0user_stats.is_parts_lockedinteger
Example:
1Notes: 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.