openapi: 3.2.0 info: title: Canvas LMS REST Assessment Question Banks API version: v1 summary: The complete Canvas LMS REST API, converted from the Swagger 1.2 documents Instructure publishes under https://canvas.instructure.com/doc/api/. description: The Canvas LMS REST API covers courses, assignments, quizzes, grades, users, enrollments, accounts, files, modules, rubrics, submissions, SIS imports, LTI, analytics and account administration. contact: name: Instructure Canvas url: https://canvas.instructure.com/doc/api/ license: name: AGPL-3.0 url: https://github.com/instructure/canvas-lms/blob/master/LICENSE servers: - url: https://canvas.instructure.com/api description: Instructure-hosted Canvas (canvas.instructure.com) - url: https://{canvas_host}/api description: Any Canvas instance; Canvas is multi-tenant and self-hostable, so the host is the institution's Canvas domain. variables: canvas_host: default: canvas.instructure.com description: Your institution's Canvas hostname, e.g. school.instructure.com security: - bearerAuth: [] - oauth2: [] tags: - name: Assessment Question Banks x-resource: assessment_question_banks externalDocs: url: https://canvas.instructure.com/doc/api/assessment_question_banks.html paths: /v1/question_banks: get: tags: - Assessment Question Banks operationId: list_question_banks summary: List question banks description: Returns the paginated list of question banks for a given context. parameters: - name: context_type in: query schema: type: string enum: - Course - Account required: true description: The type of context. Must be either "Course" or "Account". - name: context_id in: query schema: type: integer format: int64 required: true description: The id of the context. - name: include_question_count in: query schema: type: boolean required: false description: Whether to include the number of questions in each bank. responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/AssessmentQuestionBank' externalDocs: url: https://canvas.instructure.com/doc/api/assessment_question_banks.html /v1/question_banks/{id}: get: tags: - Assessment Question Banks operationId: get_single_question_bank summary: Get a single question bank description: Returns the question bank with the given id parameters: - name: id in: path schema: type: integer format: int64 required: true description: The question bank unique identifier. - name: include_question_count in: query schema: type: boolean required: false description: Whether to include the number of questions in the bank. responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/AssessmentQuestionBank' externalDocs: url: https://canvas.instructure.com/doc/api/assessment_question_banks.html /v1/question_banks/{id}/questions: get: tags: - Assessment Question Banks operationId: list_assessment_questions_for_question_bank summary: List assessment questions for a question bank description: Returns the paginated list of assessment questions in this bank. parameters: - name: id in: path schema: type: integer format: int64 required: true description: The question bank unique identifier. responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/AssessmentQuestion' externalDocs: url: https://canvas.instructure.com/doc/api/assessment_question_banks.html components: schemas: AssessmentQuestion: type: object properties: id: type: integer format: int64 example: 1 description: The ID of the assessment question. position: type: integer format: int64 example: 1 description: The order of the question. assessment_question_bank_id: type: integer format: int64 example: 3 description: The ID of the question bank this question belongs to. created_at: type: string example: '2013-01-23T23:59:00-07:00' description: The date and time when the assessment question was created. question_name: type: string example: Prime Number Identification description: The name of the question. question_type: type: string example: multiple_choice_question description: The type of the question. question_text: type: string example: Which of the following is NOT a prime number? description: The text of the question. points_possible: type: number example: 5 description: The maximum amount of points possible received for getting this question correct. correct_comments: type: string example: That's correct! description: The comments to display if the student answers the question correctly. incorrect_comments: type: string example: Unfortunately, that IS a prime number. description: The comments to display if the student answers incorrectly. neutral_comments: type: string example: Goldbach's conjecture proposes that every even integer greater than 2 can be expressed as the sum of two prime numbers. description: The comments to display regardless of how the student answered. correct_comments_html: type: string example:
That's correct!
description: The HTML version of the comments to display if the student answers the question correctly. incorrect_comments_html: type: string example:Unfortunately, that IS a prime number.
description: The HTML version of the comments to display if the student answers incorrectly. neutral_comments_html: type: string example:Goldbach's conjecture proposes that every even integer greater than 2 can be expressed as the sum of two prime numbers.
description: The HTML version of the comments to display regardless of how the student answered. answers: type: array items: type: object additionalProperties: true description: An array of available answers. Each answer contains id, text, html, comments, comments_html, and weight properties. variables: type: array items: {} description: Variables for calculated questions. Null for other question types. formulas: type: array items: {} description: Formulas for calculated questions. Null for other question types. answer_tolerance: type: string description: The tolerance for numerical answers. Null for non-numerical question types. formula_decimal_places: type: integer description: The number of decimal places for formula results. Null for non-calculated question types. matches: type: array items: {} description: Matching pairs for matching questions. Null for other question types. matching_answer_incorrect_matches: type: array items: {} description: Incorrect match options for matching questions. Null for other question types. required: - id AssessmentQuestionBank: type: object properties: id: type: integer format: int64 example: 1 description: The ID of the assessment question bank. context_id: type: integer format: int64 example: 2 description: The ID of the context (course or account) the question bank belongs to. context_type: type: string example: Course description: The type of context (Course or Account). title: type: string example: Chapter 1 Questions description: The title of the question bank. workflow_state: type: string example: active description: The workflow state of the question bank. assessment_question_count: type: integer format: int64 example: 10 description: The number of questions in the bank. context_code: type: string example: course_2 description: The combined context type and ID. created_at: type: string example: '2013-01-01T00:00:00Z' description: The date and time the question bank was created. updated_at: type: string example: '2013-01-01T00:00:00Z' description: The date and time the question bank was last updated. required: - id - context_id - context_type - title securitySchemes: bearerAuth: type: http scheme: bearer description: 'Canvas OAuth2 access token sent as "Authorization: Bearer