Create Online Exercise
Creates an exercise or assignment inside a course section. Online exercises get one empty part ("Part A"); attach a question bank to it next. Paper-based exercises (`exam_type` `2`) become assignments where learners upload their work.
/exercisescurl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/exercises' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--form 'JSONString={"section_id":"6174","is_timed":true,"exercise_name":"Online Exercise","instructions":"<p>General Instructions Write Here</p>","test_time":1800,"exam_type":1,"sound_play_times":-1,"results_declared":0,"attempts":2,"show_compiler":0,"show_calculator":0,"is_psycological":0,"is_prerequisite":1,"passing_mark":"33","is_assignment":0,"is_parts_timed":1,"is_parts_locked":1,"is_partial_marking_enabled":0,"skip_declaration":0}'{
"code": 200,
"message": "Exercise Created",
"exercise": {
"exercise_id": 1026,
"exercise_name": "Online Exercise",
"section_id": "6174",
"question_list_id": null,
"attempts": 2,
"resource_type": 5,
"file_details": []
}
}Access: Institute admins, admins, tutors who contribute to the section's course, plus custom roles with curriculum or question bank write permission.
Request body: form-data with one field, JSONString, containing this JSON:
JSONString< or >.1 online exercise with questions (default), 2 paper-based assignment (file upload).2 creates a programming assignment (must be enabled for your institute). Otherwise set from exam_type.1 if there is a time limit. Required for proctoring.0. Required when is_parts_timed is 1.-1 (unlimited).1 results are declared to learners, 0 held back. Default 0.50.0.1 advanced, 2 basic.1 learners must finish it before later content.1 gives each part its own time / forces parts in order.1 shows a calculator / code compiler.1 partial marks on multiple-correct questions.1 skips the declaration screen.1 practice mode. Cannot be combined with proctoring.0 off, 1 proctored, 2 proctored with screen and video recording. Needs is_timed.1 the assignment has due dates.1 accepts work after the due date.use_due_date is 1: {"classes": [{"class_id": 1, "type": 2, "end_date": 1735689600}]}. type 1 always open, 2 custom end date.1 turns on AI grading for paper-based assignments.200Exercise CreatedShow child attributesHide child attributes
1026Online Exercise61742Notes: Errors: "Invalid section id"; "For proctoring time is required."; "Proctoring is not supported in practice mode."; "Please add the total test time if sectional timing enabled"; an error when programming assignments are not enabled for your institute. Rate limit: 30 requests per minute; going over locks you out for 30 minutes.