Get Batch Class Section Details (Programming Assignments)
Returns the questions of an assignment, plus the assignment's settings. For programming assignments each question has a description, sample input and output, and the allowed languages. Use it to show an assignment to a learner.
GET
/assignments/questionsGet Batch Class Section Details (Programming Assignments)
curl --request GET \
--url 'https://<your-api-host>/nuSource/api/v1/assignments/questions?assignment_id=<Assignment Id>&class_id=<ClassId>'{
"code": 200,
"message": "Success",
"questions": [
{
"question_id": 6,
"assignment_id": 8,
"question": {
"description": "<p>Subtract 2 from input, if number less than 2 return 0</p>",
"sample_input": [
"4"
],
"sample_output": [
"2"
],
"allowed_languages": [
62,
70
]
},
"file_id": null,
"marks": null,
"id": null,
"file_name": null,
"file_type": null,
"file_path": null,
"file_size": null,
"file_extension": null,
"user_id": null,
"organization_id": null,
"entity_type": null,
"created_at": null,
"assignment_type": 2
}
],
"entity": {
"assignment_id": 8,
"name": "Assignment 1",
"description": "",
"course_id": 23,
"activate_at": 0,
"deactivate_at": null,
"availability": 1,
"allow_late_submissions": 0,
"max_submissions_allowed": 1,
"is_common": 1,
"marks": 100,
"status": "published",
"display_index": 4956,
"resource_type": 3,
"assignment_type": 2,
"instructions": "",
"test_time": 0
}
}Access: Any signed-in user who has access to the assignment's course (learners enrolled in it, its tutors, admins).
Query parameters
Assignment ID, from the batch curriculum.
Batch (class) ID. Used for drip-schedule checks and to record the learner's last viewed item.
Response
codeinteger
Example:
200messagestring
Example:
Successquestionsobject[]
Each
Show child attributesHide child attributes
questions.question_idinteger
Example:
6questions.assignment_idinteger
Example:
8questions.questionobject
Show child attributesHide child attributes
Example:
<p>Subtract 2 from input, if number less than 2 return 0</p>questions.question.sample_inputstring[]
questions.question.sample_outputstring[]
questions.question.allowed_languagesinteger[]
Language IDs
questions.marksnull
questions.idnull
entityobject
The assignment
Show child attributesHide child attributes
entity.assignment_idinteger
Example:
8entity.namestring
Example:
Assignment 1entity.descriptionstring
entity.course_idinteger
Example:
23entity.activate_atinteger
Example:
0Unix timestamps
entity.availabilityinteger
Example:
1Example:
0Example:
1entity.is_commoninteger
Example:
1entity.marksinteger
Example:
100entity.display_indexinteger
Example:
4956entity.instructionsstring
entity.test_timeinteger
Example:
0Notes: Learners get "assignment.not.published" for drafts. Other errors: "invalid.assignment.id" (not found or no access), and drip-schedule errors when the assignment is not yet available. Rate limit: 30 requests per 1 minute; going over locks you out for 30 minutes.