New Quizzes
Welcome to Our New API Docs! This is the new home for all things API (previously at Canvas LMS REST API Documentation).
New Quizzes API
API for accessing and building New Quizzes. To interact with New Quiz items, see the New Quiz Items API.
A NewQuiz object looks like:
{
// the ID of the quiz
"id": "5",
// the title of the quiz
"title": "Hamlet Act 3 Quiz",
// the quiz's instructions
"instructions": "<p>Welcome to the final exam for...</p>",
// the ID of the quiz's assignment group
"assignment_group_id": "3",
// The total point value given to the quiz
"points_possible": 20,
// when the quiz is due
"due_at": "2013-01-23T23:59:00-07:00",
// when to lock the quiz
"lock_at": null,
// when to unlock the quiz
"unlock_at": "2013-01-21T23:59:00-07:00",
// whether the quiz has a published or unpublished draft state
"published": true,
// the type of grading the assignment receives ('pass_fail', 'percent',
// 'letter_grade', 'gpa_scale', or 'points')
"grading_type": "points",
// additional quiz settings (see QuizSettings)
"quiz_settings": null
}A QuizSettings object looks like:
A MultipleAttemptsSettings object looks like:
A ResultViewSettings object looks like:
GET /api/quiz/v1/courses/:course_id/quizzes/:assignment_id
Scope: url:GET|/api/quiz/v1/courses/:course_id/quizzes/:assignment_id
Get details about a single new quiz.
Request Parameters:
course_id
Required integer
no description
assignment_id
Required integer
The id of the assignment associated with the quiz.
Example Request:
Returns a NewQuiz object.
GET /api/quiz/v1/courses/:course_id/quizzes
Scope: url:GET|/api/quiz/v1/courses/:course_id/quizzes
Get a list of new quizzes.
Request Parameters:
course_id
Required integer
no description
Example Request:
Returns a list of NewQuiz objects.
POST /api/quiz/v1/courses/:course_id/quizzes
Scope: url:POST|/api/quiz/v1/courses/:course_id/quizzes
Create a new quiz for the course.
Request Parameters:
course_id
Required integer
no description
quiz[title]
string
The title of the quiz.
quiz[assignment_group_id]
integer
The ID of the quiz’s assignment group.
quiz[points_possible]
number
The total point value given to the quiz. Must be positive.
quiz[due_at]
DateTime
When the quiz is due.
quiz[lock_at]
DateTime
When to lock the quiz.
quiz[unlock_at]
DateTime
When to unlock the quiz.
quiz[grading_type]
string
The type of grading the assignment receives.
Allowed values: pass_fail, percent, letter_grade, gpa_scale, points
quiz[instructions]
string
Instructions for the quiz.
quiz[quiz_settings][calculator_type]
string
Specifies which type of Calculator a student can use during Quiz taking. Should be null if no calculator is allowed.
Allowed values: none, basic, scientific
quiz[quiz_settings][filter_ip_address]
boolean
Whether IP filtering is needed. Must be true for filters to take effect.
quiz[quiz_settings][filters][ips][]
string
Specifies ranges of IP addresses where the quiz can be taken from. Each range is an array like [start address, end address], or null if there’s no restriction.
quiz[quiz_settings][multiple_attempts][multiple_attempts_enabled]
boolean
Whether multiple attempts for this quiz is true.
quiz[quiz_settings][multiple_attempts][attempt_limit]
boolean
Whether there is an attempt limit. Only set if multiple_attempts_enabled is true.
quiz[quiz_settings][multiple_attempts][max_attempts]
Positive Integer
The allowed attempts a student can take. If null, the allowed attempts are unlimited. Only used if attempt_limit is true.
quiz[quiz_settings][multiple_attempts][score_to_keep]
string
Whichever score to keep for the attempts. Only used if multiple_attempts_enabled is true.
Allowed values: average, first, highest, latest
quiz[quiz_settings][multiple_attempts][cooling_period]
boolean
Whether there is a cooling (waiting) period. Only used if multiple_attempts_enabled is true.
quiz[quiz_settings][multiple_attempts][cooling_period_seconds]
Positive Integer
Required waiting period in seconds between attempts. If null, there is no required time. Only used if cooling_period is true
quiz[quiz_settings][one_at_a_time_type]
string
Specifies the settings for questions to display when quiz taking.
Allowed values: none, question
quiz[quiz_settings][allow_backtracking]
boolean
Whether to allow user to return to previous questions when ‘one_at_a_time_type’ is set to ‘question’.
quiz[quiz_settings][result_view_settings][result_view_restricted]
boolean
Whether the results view is restricted for students. Must be true for any student restrictions to be set.
quiz[quiz_settings][result_view_settings][display_points_awarded]
boolean
Whether points are shown. Must set result_view_restricted to true to use this parameter.
quiz[quiz_settings][result_view_settings][display_points_possible]
boolean
Whether points possible is shown. Must set result_view_restricted to true to use this parameter.
quiz[quiz_settings][result_view_settings][display_items]
boolean
Whether to show items in the results view. Must be true for any items restrictions to be set.
quiz[quiz_settings][result_view_settings][display_item_response]
boolean
Whether item response is shown. Only set if display_items is true. Must be true for display_item_response_qualifier, show_item_responses_at, hide_item_responses_at, and display_item_response_correctness to be set.
quiz[quiz_settings][result_view_settings][display_item_response_qualifier]
string
Specifies after which attempts student responses should be shown to them. Only used if display_item_response is true.
Allowed values: always, once_per_attempt, after_last_attempt, once_after_last_attempt
quiz[quiz_settings][result_view_settings][show_item_responses_at]
DateTime
When student responses should be shown to them. Only used if display_item_response is true.
quiz[quiz_settings][result_view_settings][hide_item_responses_at]
DateTime
When student responses should be hidden from them. Only used if display_item_response is true.
quiz[quiz_settings][result_view_settings][display_item_response_correctness]
boolean
Whether item correctness is shown. Only set if display_item_response is true. Must be true for display_item_response_correctness_qualifier, show_item_response_correctness_at, hide_item_response_correctness_at and display_item_correct_answer to be set.
quiz[quiz_settings][result_view_settings][display_item_response_correctness_qualifier]
string
Specifies after which attempts student response correctness should be shown to them. Only used if display_item_response_correctness is true.
Allowed values: always, after_last_attempt
quiz[quiz_settings][result_view_settings][show_item_response_correctness_at]
DateTime
When student response correctness should be shown to them. Only used if display_item_response_correctness is true.
quiz[quiz_settings][result_view_settings][hide_item_response_correctness_at]
DateTime
When student response correctness should be hidden from them. Only used if display_item_response_correctness is true.
quiz[quiz_settings][result_view_settings][display_item_correct_answer]
boolean
Whether correct answer is shown. Only set if display_item_response_correctness is true.
quiz[quiz_settings][result_view_settings][display_item_feedback]
boolean
Whether Item feedback is shown. Only set if display_items is true.
quiz[quiz_settings][shuffle_answers]
boolean
Whether answers should be shuffled for students.
quiz[quiz_settings][shuffle_questions]
boolean
Whether questions should be shuffled for students.
quiz[quiz_settings][require_student_access_code]
boolean
Whether an access code is needed to take the quiz.
quiz[quiz_settings][student_access_code]
string
Access code to restrict quiz access. Should be null if no restriction.
quiz[quiz_settings][has_time_limit]
boolean
Whether there is a time limit for the quiz.
quiz[quiz_settings][session_time_limit_in_seconds]
Positive Integer
Limit the time a student can work on the quiz. Should be null if no restriction.
Example Request:
Returns a NewQuiz object.
PATCH /api/quiz/v1/courses/:course_id/quizzes/:assignment_id
Scope: url:PATCH|/api/quiz/v1/courses/:course_id/quizzes/:assignment_id
Update a single quiz for the course.
Request Parameters:
course_id
Required integer
no description
assignment_id
Required integer
The id of the assignment associated with the quiz.
quiz[title]
string
The title of the quiz.
quiz[assignment_group_id]
integer
The ID of the quiz’s assignment group.
quiz[points_possible]
number
The total point value given to the quiz. Must be positive.
quiz[due_at]
DateTime
When the quiz is due.
quiz[lock_at]
DateTime
When to lock the quiz.
quiz[unlock_at]
DateTime
When to unlock the quiz.
quiz[grading_type]
string
The type of grading the assignment receives.
Allowed values: pass_fail, percent, letter_grade, gpa_scale, points
quiz[instructions]
string
Instructions for the quiz.
quiz[quiz_settings][calculator_type]
string
Specifies which type of Calculator a student can use during Quiz taking. Should be null if no calculator is allowed.
Allowed values: none, basic, scientific
quiz[quiz_settings][filter_ip_address]
boolean
Whether IP filtering is needed. Must be true for filters to take effect.
quiz[quiz_settings][filters][ips][]
string
Specifies ranges of IP addresses where the quiz can be taken from. Each range is an array like [start address, end address], or null if there’s no restriction. Specifies the range of IP addresses where the quiz can be taken from. Should be null if there’s no restriction.
quiz[quiz_settings][multiple_attempts][multiple_attempts_enabled]
boolean
Whether multiple attempts for this quiz is true.
quiz[quiz_settings][multiple_attempts][attempt_limit]
boolean
Whether there is an attempt limit. Only set if multiple_attempts_enabled is true.
quiz[quiz_settings][multiple_attempts][max_attempts]
Positive Integer
The allowed attempts a student can take. If null, the allowed attempts are unlimited. Only used if attempt_limit is true.
quiz[quiz_settings][multiple_attempts][score_to_keep]
string
Whichever score to keep for the attempts. Only used if multiple_attempts_enabled is true.
Allowed values: average, first, highest, latest
quiz[quiz_settings][multiple_attempts][cooling_period]
boolean
Whether there is a cooling period. Only used if multiple_attempts_enabled is true.
quiz[quiz_settings][multiple_attempts][cooling_period_seconds]
Positive Integer
Required waiting period in seconds between attempts. If null, there is no required time. Only used if cooling_period is true.
quiz[quiz_settings][one_at_a_time_type]
string
Specifies the settings for questions to display when quiz taking.
Allowed values: none, question
quiz[quiz_settings][allow_backtracking]
boolean
Whether to allow user to return to previous questions when ‘one_at_a_time_type’ is set to ‘question’.
quiz[quiz_settings][result_view_settings][result_view_restricted]
boolean
Whether the results view is restricted for students. Must be true for any student restrictions to be set.
quiz[quiz_settings][result_view_settings][display_points_awarded]
boolean
Whether points are shown. Must set result_view_restricted to true to use this parameter.
quiz[quiz_settings][result_view_settings][display_points_possible]
boolean
Whether points possible is shown. Must set result_view_restricted to true to use this parameter.
quiz[quiz_settings][result_view_settings][display_items]
boolean
Whether to show items in the results view. Must be true for any items restrictions to be set.
quiz[quiz_settings][result_view_settings][display_item_response]
boolean
Whether item response is shown. Only set if display_items is true. Must be true for display_item_response_qualifier, show_item_responses_at, hide_item_responses_at, and display_item_response_correctness to be set.
quiz[quiz_settings][result_view_settings][display_item_response_qualifier]
string
Specifies after which attempts student responses should be shown to them. Only used if display_item_response is true.
Allowed values: always, once_per_attempt, after_last_attempt, once_after_last_attempt
quiz[quiz_settings][result_view_settings][show_item_responses_at]
DateTime
When student responses should be shown to them. Only used if display_item_response is true.
quiz[quiz_settings][result_view_settings][hide_item_responses_at]
DateTime
When student responses should be hidden from them. Only used if display_item_response is true.
quiz[quiz_settings][result_view_settings][display_item_response_correctness]
boolean
Whether item correctness is shown. Only set if display_item_response is true. Must be true for display_item_response_correctness_qualifier, show_item_response_correctness_at, hide_item_response_correctness_at and display_item_correct_answer to be set.
quiz[quiz_settings][result_view_settings][display_item_response_correctness_qualifier]
string
Specifies after which attempts student response correctness should be shown to them. Only used if display_item_response_correctness is true.
Allowed values: always, after_last_attempt
quiz[quiz_settings][result_view_settings][show_item_response_correctness_at]
DateTime
When student response correctness should be shown to them. Only used if display_item_response_correctness is true.
quiz[quiz_settings][result_view_settings][hide_item_response_correctness_at]
DateTime
When student response correctness should be hidden from them. Only used if display_item_response_correctness is true.
quiz[quiz_settings][result_view_settings][display_item_correct_answer]
boolean
Whether correct answer is shown. Only set if display_item_response_correctness is true.
quiz[quiz_settings][result_view_settings][display_item_feedback]
boolean
Whether Item feedback is shown. Only set if display_items is true.
quiz[quiz_settings][shuffle_answers]
boolean
Whether answers should be shuffled for students.
quiz[quiz_settings][shuffle_questions]
boolean
Whether questions should be shuffled for students.
quiz[quiz_settings][require_student_access_code]
boolean
Whether an access code is needed to take the quiz.
quiz[quiz_settings][student_access_code]
string
Access code to restrict quiz access. Should be null if no restriction.
quiz[quiz_settings][has_time_limit]
boolean
Whether there is a time limit for the quiz.
quiz[quiz_settings][session_time_limit_in_seconds]
Positive Integer
Limit the time a student can work on the quiz. Should be null if no restriction.
Example Request:
Returns a NewQuiz object.
DELETE /api/quiz/v1/courses/:course_id/quizzes/:assignment_id
Scope: url:DELETE|/api/quiz/v1/courses/:course_id/quizzes/:assignment_id
Delete a single new quiz.
Request Parameters:
course_id
Required integer
no description
assignment_id
Required integer
The id of the assignment associated with the quiz.
Example Request:
Returns a NewQuiz object.
This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated
Was this helpful?