🚀 Heads up: Our API Docs Have Moved!
We have relocated to Instructure Developer Documentation Portal. 🎉 Please update your bookmarks. This page will automatically redirect after July 1, 2026.
We have relocated to Instructure Developer Documentation Portal. 🎉 Please update your bookmarks. This page will automatically redirect after July 1, 2026.
Assessment Question Banks API
An AssessmentQuestionBank object looks like:
{
// The ID of the assessment question bank.
"id": 1,
// The ID of the context (course or account) the question bank belongs to.
"context_id": 2,
// The type of context (Course or Account).
"context_type": "Course",
// The title of the question bank.
"title": "Chapter 1 Questions",
// The workflow state of the question bank.
"workflow_state": "active",
// The number of questions in the bank.
"assessment_question_count": 10,
// The combined context type and ID.
"context_code": "course_2",
// The date and time the question bank was created.
"created_at": "2013-01-01T00:00:00Z",
// The date and time the question bank was last updated.
"updated_at": "2013-01-01T00:00:00Z"
}
An AssessmentQuestion object looks like:
{
// The ID of the assessment question.
"id": 1,
// The order of the question.
"position": 1,
// The ID of the question bank this question belongs to.
"assessment_question_bank_id": 3,
// The date and time when the assessment question was created.
"created_at": "2013-01-23T23:59:00-07:00",
// The name of the question.
"question_name": "Prime Number Identification",
// The type of the question.
"question_type": "multiple_choice_question",
// The text of the question.
"question_text": "Which of the following is NOT a prime number?",
// The maximum amount of points possible received for getting this question
// correct.
"points_possible": 5,
// The comments to display if the student answers the question correctly.
"correct_comments": "That's correct!",
// The comments to display if the student answers incorrectly.
"incorrect_comments": "Unfortunately, that IS a prime number.",
// The comments to display regardless of how the student answered.
"neutral_comments": "Goldbach's conjecture proposes that every even integer greater than 2 can be expressed as the sum of two prime numbers.",
// The HTML version of the comments to display if the student answers the
// question correctly.
"correct_comments_html": "<p>That's correct!</p>",
// The HTML version of the comments to display if the student answers
// incorrectly.
"incorrect_comments_html": "<p>Unfortunately, that IS a prime number.</p>",
// The HTML version of the comments to display regardless of how the student
// answered.
"neutral_comments_html": "<p>Goldbach's conjecture proposes that every even integer greater than 2 can be expressed as the sum of two prime numbers.</p>",
// An array of available answers. Each answer contains id, text, html, comments,
// comments_html, and weight properties.
"answers": null,
// Variables for calculated questions. Null for other question types.
"variables": null,
// Formulas for calculated questions. Null for other question types.
"formulas": null,
// The tolerance for numerical answers. Null for non-numerical question types.
"answer_tolerance": null,
// The number of decimal places for formula results. Null for non-calculated
// question types.
"formula_decimal_places": null,
// Matching pairs for matching questions. Null for other question types.
"matches": null,
// Incorrect match options for matching questions. Null for other question
// types.
"matching_answer_incorrect_matches": null
}
List question banks AssessmentQuestionBanksController#index
GET /api/v1/question_banks
Scope:
url:GET|/api/v1/question_banks
Returns the paginated list of question banks for a given context.
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| context_type | Required | string |
The type of context. Must be either “Course” or “Account”.
Allowed values: |
| context_id | Required | integer |
The id of the context. |
| include_question_count | boolean |
Whether to include the number of questions in each bank. |
Example Request:
curl 'https://<canvas>/api/v1/question_banks?context_type=Course&context_id=1' \
-H 'Authorization: Bearer <token>'
Get a single question bank AssessmentQuestionBanksController#show
GET /api/v1/question_banks/:id
Scope:
url:GET|/api/v1/question_banks/:id
Returns the question bank with the given id
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| id | Required | integer |
The question bank unique identifier. |
| include_question_count | boolean |
Whether to include the number of questions in the bank. |
List assessment questions for a question bank AssessmentQuestionBanksController#questions
GET /api/v1/question_banks/:id/questions
Scope:
url:GET|/api/v1/question_banks/:id/questions
Returns the paginated list of assessment questions in this bank.
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| id | Required | integer |
The question bank unique identifier. |
Example Request:
curl 'https://<canvas>/api/v1/question_banks/:id/questions' \
-H 'Authorization: Bearer <token>'