Quiz Submissions
API for accessing quiz submissions
A QuizSubmission object looks like:
Quizzes::QuizSubmissionsApiController#index
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions
Scope: url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/submissions
Get a list of all submissions for this quiz. Users who can view or manage grades for a course will have submissions from multiple users returned. A user who can only submit will have only their own submissions returned. When a user has an in-progress submission, only that submission is returned. When there isn’t an in-progress quiz_submission, all completed submissions, including previous attempts, are returned.
200 OK response code is returned if the request was successful.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Associations to include with the quiz submission. Allowed values: |
Example Response:
Quizzes::QuizSubmissionsApiController#submission
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submission
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submission
Scope: url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/submission
Get the submission for this quiz for the current user.
200 OK response code is returned if the request was successful.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Associations to include with the quiz submission. Allowed values: |
Example Response:
Quizzes::QuizSubmissionsApiController#show
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id
Scope: url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id
Get a single quiz submission.
200 OK response code is returned if the request was successful.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Associations to include with the quiz submission. Allowed values: |
Example Response:
Quizzes::QuizSubmissionsApiController#create
POST /api/v1/courses/:course_id/quizzes/:quiz_id/submissions
POST /api/v1/courses/:course_id/quizzes/:quiz_id/submissions
Scope: url:POST|/api/v1/courses/:course_id/quizzes/:quiz_id/submissions
Start taking a Quiz by creating a QuizSubmission which you can use to answer questions and submit your answers.
Responses
200 OK if the request was successful
400 Bad Request if the quiz is locked
403 Forbidden if an invalid access code is specified
403 Forbidden if the Quiz’s IP filter restriction does not pass
409 Conflict if a QuizSubmission already exists for this user and quiz
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Access code for the Quiz, if any. |
|
| Whether this should be a preview QuizSubmission and not count towards the user’s course record. Teachers only. |
Example Response:
Quizzes::QuizSubmissionsApiController#update
PUT /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id
PUT /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id
Scope: url:PUT|/api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id
Update the amount of points a student has scored for questions they’ve answered, provide comments for the student about their answer(s), or simply fudge the total score by a specific amount of points.
Responses
200 OK if the request was successful
403 Forbidden if you are not a teacher in this course
400 Bad Request if the attempt parameter is missing or invalid
400 Bad Request if the specified QS attempt is not yet complete
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | The attempt number of the quiz submission that should be updated. This attempt MUST be already completed. |
|
| Amount of positive or negative points to fudge the total score by. |
|
| A set of scores and comments for each question answered by the student. The keys are the question IDs, and the values are hashes of ‘score |
Example Request:
Example Response:
See Also:
Quizzes::QuizSubmissionsApiController#complete
POST /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id/complete
POST /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id/complete
Scope: url:POST|/api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id/complete
Complete the quiz submission by marking it as complete and grading it. When the quiz submission has been marked as complete, no further modifications will be allowed.
Responses
200 OK if the request was successful
403 Forbidden if an invalid access code is specified
403 Forbidden if the Quiz’s IP filter restriction does not pass
403 Forbidden if an invalid token is specified
400 Bad Request if the QS is already complete
400 Bad Request if the attempt parameter is missing
400 Bad Request if the attempt parameter is not the latest attempt
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | The attempt number of the quiz submission that should be completed. Note that this must be the latest attempt index, as earlier attempts can not be modified. |
| Required | The unique validation token you received when this Quiz Submission was created. |
|
| Access code for the Quiz, if any. |
Example Response:
Quizzes::QuizSubmissionsApiController#time
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id/time
GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id/time
Scope: url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id/time
Get the current timing data for the quiz attempt, both the end_at timestamp and the time_left parameter.
Responses
200 OK if the request was successful
Example Response:
Appendixes
Appendix: Manual Scoring
Parameter synopsis
More example requests
Fudging the score by a negative amount
Removing an earlier comment on a question
© Instructure, Inc. Generated on Wed Nov 6 14:20:09 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated