Docs home

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/quizzes
Create 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:

BodyJSONString
course_idintegerrequired
Course to add the test to.
quiz_namestring
Name, up to 100 characters, no < or >.
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).
1 results are declared to learners, 0 held back. Default 0.
exam_typeinteger
1 online (default), 2 paper-based.
Pass mark. Default 50.
quiz_modeinteger
1 advanced, 2 basic (default).
Minimum class attendance a learner needs before attempting. Leave out for no rule.
1 learners must finish this before later content. Default 0.
1 each part has its own time. Default 0.
1 parts must be taken in order. Default 0.
1 shows an on-screen calculator. Default 0.
1 shows a code compiler. Default 0.
1 psychological test (no right answers). Default 0.
1 gives partial marks on multiple-correct questions. Default 0.
1 skips the declaration screen before starting. Default 0.
1 practice mode. Cannot be combined with proctoring.
0 off (default), 1 proctored, 2 proctored with screen and video recording. Needs is_timed.
1 shows a reference sheet during the test.
Reference sheet title.
Reference sheet content, HTML allowed.
Response200application/json
codeinteger
Example: 200
messagestring
Example: Quiz Created
quizobject
Show child attributesHide child attributes
Example: 528
Example: MyTest 1
Example: 446
Null, no bank yet
Example: 1
2 = test
Example: 2

Notes: 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.

Updated yesterday

Ask AI