Create New Test
Creates a new test (quiz) in a course. The test starts as an unpublished, unavailable draft with one empty part ("Part A"); attach a question bank to it next.
POST
/quizzesCreate New Test
curl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/quizzes' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--form 'JSONString={
"course_id": <bundleId>,
"quiz_name": "MyTest 1",
"instructions": "<p>DemoTest</p>",
"sound_play_times": -1,
"exam_type": 1,
"results_declared": 1,
"attempts": 1,
"show_compiler": 0,
"is_psycological": 0,
"is_prerequisite": 0,
"passing_mark": "70",
"is_parts_timed": 0
}'{
"code": 200,
"message": "Quiz Created",
"quiz": {
"quiz_id": 528,
"quiz_name": "MyTest 1",
"course_id": 446,
"question_list_id": null,
"attempts": 1,
"resource_type": 2
}
}Access: Institute admins, admins, tutors of the course, plus custom roles with curriculum or question bank write permission.
Request body: form-data with one field, JSONString, containing this JSON:
Body
JSONStringCourse to add the test to.
quiz_namestring
Name, up to 100 characters, no
< or >.instructionsstring
Instructions shown before the test, HTML allowed.
is_timedinteger
1 if the test has a time limit. Required for proctoring.test_timeinteger
Time limit in seconds. Default
0 (untimed).attemptsinteger
Attempts allowed. Default
-1 (unlimited).results_declaredinteger
1 results are declared to learners, 0 held back. Default 0.exam_typeinteger
1 online (default), 2 paper-based.passing_markinteger
Pass mark. Default
50.quiz_modeinteger
1 advanced, 2 basic (default).min_attendance_percentinteger
Minimum class attendance a learner needs before attempting. Leave out for no rule.
is_prerequisiteinteger
1 learners must finish this before later content. Default 0.is_parts_timedinteger
1 each part has its own time. Default 0.is_parts_lockedinteger
1 parts must be taken in order. Default 0.show_calculatorinteger
1 shows an on-screen calculator. Default 0.show_compilerinteger
1 shows a code compiler. Default 0.is_psycologicalinteger
1 psychological test (no right answers). Default 0.is_partial_marking_enabledinteger
1 gives partial marks on multiple-correct questions. Default 0.skip_declarationinteger
1 skips the declaration screen before starting. Default 0.is_practice_mode_enabledinteger
1 practice mode. Cannot be combined with proctoring.exam_online_proctoringinteger
0 off (default), 1 proctored, 2 proctored with screen and video recording. Needs is_timed.show_reference_sheetinteger
1 shows a reference sheet during the test.reference_sheet_titlestring
Reference sheet title.
reference_sheet_contentstring
Reference sheet content, HTML allowed.
Response
codeinteger
Example:
200messagestring
Example:
Quiz Createdquizobject
Show child attributesHide child attributes
quiz.quiz_idinteger
Example:
528quiz.quiz_namestring
Example:
MyTest 1quiz.course_idinteger
Example:
446Null, no bank yet
quiz.attemptsinteger
Example:
1Notes: Error "For proctoring time is required." when proctoring is on without is_timed. Tutors get "Invalid Resource ID" for a course they don't teach. Rate limit: 30 requests per minute; going over locks you out for 30 minutes.