-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_doc_api_quizzes.html.txt
264 lines (209 loc) · 14.8 KB
/
_doc_api_quizzes.html.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
Quizzes API
A Quiz object looks like:
{
// the ID of the quiz
"id": 5,
// the title of the quiz
"title": "Hamlet Act 3 Quiz",
// the HTTP/HTTPS URL to the quiz
"html_url": "http://canvas.example.edu/courses/1/quizzes/2",
// a url suitable for loading the quiz in a mobile webview. it will persiste
// the headless session and, for quizzes in public courses, will force the user
// to login
"mobile_url": "http://canvas.example.edu/courses/1/quizzes/2?persist_healdess=1&force_user=1",
// A url that can be visited in the browser with a POST request to preview a
// quiz as the teacher. Only present when the user may grade
"preview_url": "http://canvas.example.edu/courses/1/quizzes/2/take?preview=1",
// the description of the quiz
"description": "This is a quiz on Act 3 of Hamlet",
// type of quiz possible values: 'practice_quiz', 'assignment', 'graded_survey',
// 'survey'
"quiz_type": "assignment",
// the ID of the quiz's assignment group:
"assignment_group_id": 3,
// quiz time limit in minutes
"time_limit": 5,
// shuffle answers for students?
"shuffle_answers": false,
// let students see their quiz responses? possible values: null, 'always',
// 'until_after_last_attempt'
"hide_results": "always",
// show which answers were correct when results are shown? only valid if
// hide_results=null
"show_correct_answers": true,
// restrict the show_correct_answers option above to apply only to the last
// submitted attempt of a quiz that allows multiple attempts. only valid if
// show_correct_answers=true and allowed_attempts > 1
"show_correct_answers_last_attempt": true,
// when should the correct answers be visible by students? only valid if
// show_correct_answers=true
"show_correct_answers_at": "2013-01-23T23:59:00-07:00",
// prevent the students from seeing correct answers after the specified date has
// passed. only valid if show_correct_answers=true
"hide_correct_answers_at": "2013-01-23T23:59:00-07:00",
// prevent the students from seeing their results more than once (right after
// they submit the quiz)
"one_time_results": true,
// which quiz score to keep (only if allowed_attempts != 1) possible values:
// 'keep_highest', 'keep_latest'
"scoring_policy": "keep_highest",
// how many times a student can take the quiz -1 = unlimited attempts
"allowed_attempts": 3,
// show one question at a time?
"one_question_at_a_time": false,
// the number of questions in the quiz
"question_count": 12,
// The total point value given to the quiz
"points_possible": 20,
// lock questions after answering? only valid if one_question_at_a_time=true
"cant_go_back": false,
// access code to restrict quiz access
"access_code": "2beornot2be",
// IP address or range that quiz access is limited to
"ip_filter": "123.123.123.123",
// 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,
// Whether the assignment's 'published' state can be changed to false. Will be
// false if there are student submissions for the quiz.
"unpublishable": true,
// Whether or not this is locked for the user.
"locked_for_user": false,
// (Optional) Information for the user about the lock. Present when
// locked_for_user is true.
"lock_info": null,
// (Optional) An explanation of why this is locked for the user. Present when
// locked_for_user is true.
"lock_explanation": "This quiz is locked until September 1 at 12:00am",
// Link to Speed Grader for this quiz. Will not be present if quiz is
// unpublished
"speedgrader_url": "http://canvas.instructure.com/courses/1/speed_grader?assignment_id=1",
// Link to endpoint to send extensions for this quiz.
"quiz_extensions_url": "http://canvas.instructure.com/courses/1/quizzes/2/quiz_extensions",
// Permissions the user has for the quiz
"permissions": null,
// list of due dates for the quiz
"all_dates": null,
// Current version number of the quiz
"version_number": 3,
// List of question types in the quiz
"question_types": ["multiple_choice", "essay"],
// Whether survey submissions will be kept anonymous (only applicable to
// 'graded_survey', 'survey' quiz types)
"anonymous_submissions": false
}
A QuizPermissions object looks like:
// Permissions the user has for the quiz
{
// whether the user can view the quiz
"read": true,
// whether the user may submit a submission for the quiz
"submit": true,
// whether the user may create a new quiz
"create": true,
// whether the user may edit, update, or delete the quiz
"manage": true,
// whether the user may view quiz statistics for this quiz
"read_statistics": true,
// whether the user may review grades for all quiz submissions for this quiz
"review_grades": true,
// whether the user may update the quiz
"update": true
}
List quizzes in a courseQuizzes::QuizzesApiController#index
GET /api/v1/courses/:course_id/quizzes
Returns the paginated list of Quizzes in this course.
Parameter | | Type | Description
search_term | | string | The partial title of the quizzes to match and return.
The partial title of the quizzes to match and return.
curl https://<canvas>/api/v1/courses/<course_id>/quizzes \
-H 'Authorization: Bearer <token>'
Get a single quizQuizzes::QuizzesApiController#show
GET /api/v1/courses/:course_id/quizzes/:id
Returns the quiz with the given id.
Create a quizQuizzes::QuizzesApiController#create
POST /api/v1/courses/:course_id/quizzes
Create a new quiz for this course.
Parameter | | Type | Description
quiz[title] | Required | string | The quiz title.
quiz[description] | | string | A description of the quiz.
quiz[quiz_type] | | string | The type of quiz.Allowed values:practice_quiz,assignment,graded_survey,survey
quiz[assignment_group_id] | | integer | The assignment group id to put the assignment in. Defaults to the top assignment group in the course. Only valid if the quiz is graded, i.e. if quiz_type is âassignmentâ or âgraded_surveyâ.
quiz[time_limit] | | integer | Time limit to take this quiz, in minutes. Set to null for no time limit. Defaults to null.
quiz[shuffle_answers] | | boolean | If true, quiz answers for multiple choice questions will be randomized for each student. Defaults to false.
quiz[hide_results] | | string | Dictates whether or not quiz results are hidden from students. If null, students can see their results after any attempt. If âalwaysâ, students can never see their results. If âuntil_after_last_attemptâ, students can only see results after their last attempt. (Only valid if allowed_attempts > 1). Defaults to null.Allowed values:always,until_after_last_attempt
quiz[show_correct_answers] | | boolean | Only valid if hide_results=null If false, hides correct answers from students when quiz results are viewed. Defaults to true.
quiz[show_correct_answers_last_attempt] | | boolean | Only valid if show_correct_answers=true and allowed_attempts > 1 If true, hides correct answers from students when quiz results are viewed until they submit the last attempt for the quiz. Defaults to false.
quiz[show_correct_answers_at] | | DateTime | Only valid if show_correct_answers=true If set, the correct answers will be visible by students only after this date, otherwise the correct answers are visible once the student hands in their quiz submission.
quiz[hide_correct_answers_at] | | DateTime | Only valid if show_correct_answers=true If set, the correct answers will stop being visible once this date has passed. Otherwise, the correct answers will be visible indefinitely.
quiz[allowed_attempts] | | integer | Number of times a student is allowed to take a quiz. Set to -1 for unlimited attempts. Defaults to 1.
quiz[scoring_policy] | | string | Required and only valid if allowed_attempts > 1. Scoring policy for a quiz that students can take multiple times. Defaults to âkeep_highestâ.Allowed values:keep_highest,keep_latest
quiz[one_question_at_a_time] | | boolean | If true, shows quiz to student one question at a time. Defaults to false.
quiz[cant_go_back] | | boolean | Only valid if one_question_at_a_time=true If true, questions are locked after answering. Defaults to false.
quiz[access_code] | | string | Restricts access to the quiz with a password. For no access code restriction, set to null. Defaults to null.
quiz[ip_filter] | | string | Restricts access to the quiz to computers in a specified IP range. Filters can be a comma-separated list of addresses, or an address followed by a maskExamples:"192.168.217.1""192.168.217.1/24""192.168.217.1/255.255.255.0"For no IP filter restriction, set to null. Defaults to null.
quiz[due_at] | | DateTime | The day/time the quiz is due. Accepts times in ISO 8601 format, e.g. 2011-10-21T18:48Z.
quiz[lock_at] | | DateTime | The day/time the quiz is locked for students. Accepts times in ISO 8601 format, e.g. 2011-10-21T18:48Z.
quiz[unlock_at] | | DateTime | The day/time the quiz is unlocked for students. Accepts times in ISO 8601 format, e.g. 2011-10-21T18:48Z.
quiz[published] | | boolean | Whether the quiz should have a draft state of published or unpublished. NOTE: If students have started taking the quiz, or there are any submissions for the quiz, you may not unpublish a quiz and will recieve an error.
quiz[one_time_results] | | boolean | Whether students should be prevented from viewing their quiz results past the first time (right after they turn the quiz in.) Only valid if âhide_resultsâ is not set to âalwaysâ. Defaults to false.
quiz[only_visible_to_overrides] | | boolean | Whether this quiz is only visible to overrides (Only useful if âdifferentiated assignmentsâ account setting is on) Defaults to false.
The quiz title.
A description of the quiz.
The type of quiz.
Allowed values:practice_quiz,assignment,graded_survey,survey
The assignment group id to put the assignment in. Defaults to the top assignment group in the course. Only valid if the quiz is graded, i.e. if quiz_type is âassignmentâ or âgraded_surveyâ.
Time limit to take this quiz, in minutes. Set to null for no time limit. Defaults to null.
If true, quiz answers for multiple choice questions will be randomized for each student. Defaults to false.
Dictates whether or not quiz results are hidden from students. If null, students can see their results after any attempt. If âalwaysâ, students can never see their results. If âuntil_after_last_attemptâ, students can only see results after their last attempt. (Only valid if allowed_attempts > 1). Defaults to null.
Allowed values:always,until_after_last_attempt
Only valid if hide_results=null If false, hides correct answers from students when quiz results are viewed. Defaults to true.
Only valid if show_correct_answers=true and allowed_attempts > 1 If true, hides correct answers from students when quiz results are viewed until they submit the last attempt for the quiz. Defaults to false.
Only valid if show_correct_answers=true If set, the correct answers will be visible by students only after this date, otherwise the correct answers are visible once the student hands in their quiz submission.
Only valid if show_correct_answers=true If set, the correct answers will stop being visible once this date has passed. Otherwise, the correct answers will be visible indefinitely.
Number of times a student is allowed to take a quiz. Set to -1 for unlimited attempts. Defaults to 1.
Required and only valid if allowed_attempts > 1. Scoring policy for a quiz that students can take multiple times. Defaults to âkeep_highestâ.
Allowed values:keep_highest,keep_latest
If true, shows quiz to student one question at a time. Defaults to false.
Only valid if one_question_at_a_time=true If true, questions are locked after answering. Defaults to false.
Restricts access to the quiz with a password. For no access code restriction, set to null. Defaults to null.
Restricts access to the quiz to computers in a specified IP range. Filters can be a comma-separated list of addresses, or an address followed by a mask
Examples:
"192.168.217.1""192.168.217.1/24""192.168.217.1/255.255.255.0"
For no IP filter restriction, set to null. Defaults to null.
The day/time the quiz is due. Accepts times in ISO 8601 format, e.g. 2011-10-21T18:48Z.
The day/time the quiz is locked for students. Accepts times in ISO 8601 format, e.g. 2011-10-21T18:48Z.
The day/time the quiz is unlocked for students. Accepts times in ISO 8601 format, e.g. 2011-10-21T18:48Z.
Whether the quiz should have a draft state of published or unpublished. NOTE: If students have started taking the quiz, or there are any submissions for the quiz, you may not unpublish a quiz and will recieve an error.
Whether students should be prevented from viewing their quiz results past the first time (right after they turn the quiz in.) Only valid if âhide_resultsâ is not set to âalwaysâ. Defaults to false.
Whether this quiz is only visible to overrides (Only useful if âdifferentiated assignmentsâ account setting is on) Defaults to false.
Edit a quizQuizzes::QuizzesApiController#update
PUT /api/v1/courses/:course_id/quizzes/:id
Modify an existing quiz. See the documentation for quiz creation.
Additional arguments:
Parameter | | Type | Description
quiz[notify_of_update] | | boolean | If true, notifies users that the quiz has changed. Defaults to true
If true, notifies users that the quiz has changed. Defaults to true
Delete a quizQuizzes::QuizzesApiController#destroy
DELETE /api/v1/courses/:course_id/quizzes/:id
Reorder quiz itemsQuizzes::QuizzesApiController#reorder
POST /api/v1/courses/:course_id/quizzes/:id/reorder
Change order of the quiz questions or groups within the quiz
204 No Contentresponse code is returned if the reorder was successful.
Parameter | | Type | Description
order[][id] | Required | integer | The associated itemâs unique identifier
order[][type] | | string | The type of item is either âquestionâ or âgroupâAllowed values:question,group
The associated itemâs unique identifier
The type of item is either âquestionâ or âgroupâ
Allowed values:question,group
Validate quiz access codeQuizzes::QuizzesApiController#validate_access_code
POST /api/v1/courses/:course_id/quizzes/:id/validate_access_code
Accepts an access code and returns a boolean indicating whether that access code is correct
Parameter | | Type | Description
access_code | Required | string | The access code being validated
The access code being validated