Instructure Developer Documentation Portal
Community
  • Introduction
  • Services
    • Elevate Standards Alignment - AB Connect API
      • Introduction
        • Authentication
        • Addressing Object Properties
        • Requesting Additional Properties in the Response
        • Filtering Using ODATA Like Statements
        • Sorting
        • Facets
        • Paging Data
        • Call Throttling
        • Working with Related Object
        • Error Responses
        • Character Set Support
        • How To Articles, Recommendations and Suggestions
        • Examples
        • Using AB Connect's Embeddable Widgets
      • Reference
        • Standards
        • Standard Collections
        • Events
        • Topics
        • Concepts
        • Assets
        • Asset Definitions
        • Asset Collections
        • Managing and Predicting Relationships
        • Providers
    • Canvas LMS
      • Basics
        • GraphQL
        • API Change Log
        • SIS IDs
        • Pagination
        • Throttling
        • Compound Documents
        • File Uploads
        • API Endpoint Attributes
        • Masquerading
      • OAuth2
        • OAuth2 Overview
        • OAuth2 Endpoints
        • Developer Keys
      • Resources
        • Access Tokens
        • Account Calendars
        • Account Domain Lookups
        • Account Notifications
        • Account Reports
        • Accounts
        • Accounts (LTI)
        • Admins
        • Analytics
        • Announcement External Feeds
        • Announcements
        • API Token Scopes
        • Appointment Groups
        • Assignment Extensions
        • Assignment Groups
        • Assignments
        • Authentication Providers
        • Authentications Log
        • Blackout Dates
        • BlockEditorTemplate
        • Blueprint Courses
        • Bookmarks
        • Brand Configs
        • Calendar Events
        • Collaborations
        • CommMessages
        • Communication Channels
        • Conferences
        • Content Exports
        • Content Migrations
        • Content Security Policy Settings
        • Content Shares
        • Conversations
        • Course Audit log
        • Course Pace
        • Course Quiz Extensions
        • Course Reports
        • Courses
        • Custom Gradebook Columns
        • Developer Key Account Bindings
        • Developer Keys
        • Discussion Topics
        • Enrollment Terms
        • Enrollments
        • ePortfolios
        • ePub Exports
        • Error Reports
        • External Tools
        • Favorites
        • Feature Flags
        • Files
        • Grade Change Log
        • Gradebook History
        • Grading Period Sets
        • Grading Periods
        • Grading Standards
        • Group Categories
        • Groups
        • History
        • InstAccess tokens
        • JWTs
        • Late Policy
        • Learning Object Dates
        • Line Items
        • LiveAssessments
        • Logins
        • LTI Launch Definitions
        • LTI Registrations
        • LTI Resource Links
        • Media Objects
        • Moderated Grading
        • Modules
        • Names and Role
        • New Quiz Items
        • New Quizzes
        • New Quizzes Accommodations
        • New Quizzes Reports
        • Notification Preferences
        • Originality Reports
        • Outcome Groups
        • Outcome Imports
        • Outcome Results
        • Outcomes
        • Pages
        • Peer Reviews
        • Planner
        • Poll Sessions
        • PollChoices
        • Polls
        • PollSubmissions
        • Proficiency Ratings
        • Progress
        • Public JWK
        • Quiz Assignment Overrides
        • Quiz Extensions
        • Quiz IP Filters
        • Quiz Question Groups
        • Quiz Questions
        • Quiz Reports
        • Quiz Statistics
        • Quiz Submission Events
        • Quiz Submission Files
        • Quiz Submission Questions
        • Quiz Submission User List
        • Quiz Submissions
        • Quizzes
        • Result
        • Roles
        • Rubrics
        • Sandboxes
        • Score
        • Search
        • Sections
        • Services
        • Shared Brand Configs
        • SIS Import Errors
        • SIS Imports
        • SIS Integration
        • Smart Search
        • Submission Comments
        • Submissions
        • Tabs
        • Temporary Enrollment Pairings
        • User Observees
        • Users
        • What If Grades
      • Outcomes
        • Outcomes CSV Format
      • Group Categories
        • Group Categories CSV Format
      • SIS
        • SIS CSV Format
      • External Tools
        • LTI
          • Introduction
          • Registration
          • Launch Overview
          • Configuring
          • Variable Substitutions
          • Deep Linking
          • Grading
          • Provisioning
          • PostMessage
          • Platform Notification Service
          • Placements
            • Placements Overview
            • Navigation
            • Homework Submission
            • Editor Button
            • Migration Selection
            • Link Selection (Modules)
            • Assignment Selection
            • Collaborations
        • xAPI
        • Canvas Roles
        • Plagiarism Detection Platform
          • Overview
          • Plagiarism Detection Platform Assignments
          • Plagiarism Detection Platform Users
          • Plagiarism Detection Submissions
          • Webhooks Subscriptions for Plagiarism Platform
          • JWT Access Tokens
      • Data Services
        • Live Events
          • Overview
            • Introduction
            • Setup
            • Caliper
            • Metadata
          • Event Format
            • Canvas
              • Account
              • Asset
              • Assignment
              • Attachment
              • Content
              • Conversation
              • Course
              • Discussion
              • Enrollment
              • Grade
              • Group
              • Learning
              • Logged
              • Module
              • Outcome
              • Outcomes
              • Plagiarism
              • Quiz
              • Rubric
              • Sis
              • Submission
              • Syllabus
              • User
              • Wiki
            • Caliper IMS 1.1
              • Assessment
              • Basic
              • Forum
              • Grading
              • Navigation Events
              • Session
    • Catalog
      • APIs
        • Analytics
        • Bulk Enrollments
        • Catalogs
        • Certificates
        • Completed Certificates
        • Courses
        • Email Domain Set
        • Enrollments
        • Orders
        • Programs
        • Progresses
        • Tags
        • User Registrations
        • Users
        • Waitlist Applicants
    • Credentials
      • Getting Started
      • Authentication
        • Password-Based Authentication
        • Authorization Code-Based Authentication
      • Pagination
      • APIs
        • Assertions
        • Backpack
        • Badgeclasses
        • Issuers
        • Organizations
        • Users
      • Release Notes
    • Data Access Platform
      • Key Concepts
      • Data Formats
      • Rate Limits & Policies
      • Datasets
        • Namespaces
          • canvas
            • canvas types
          • canvas_logs
          • catalog
        • Additional Notes
        • Entity Relationship Diagram
      • Query API
        • Authentication
        • Reference
      • Command Line (DAP CLI)
        • Getting Started
        • Secure Connection
        • Reference
          • dap snapshot
          • dap incremental
          • dap list
          • dap schema
          • dap initdb
          • dap syncdb
          • dap dropdb
      • Client Library
        • Examples
        • Reference
      • Release Notes
      • Status
    • DataSync
      • Interop API
      • Interop Data API
      • Grades Exchange API
      • OneRoster API
      • Platform API
    • Instructure Media
      • Studio API
    • Quizzes
      • Quiz API
Powered by GitBook

Copyright © 2008-2024 Instructure, Inc. All rights reserved. Various trademarks held by their respective owners.

On this page
  • List questions in a quiz or a submission
  • Get a single quiz question
  • Create a single quiz question
  • Update an existing quiz question
  • Delete a quiz question

Was this helpful?

  1. Services
  2. Canvas LMS
  3. Resources

Quiz Questions

A QuizQuestion object looks like:

{
  // The ID of the quiz question.
  "id": 1,
  // The ID of the Quiz the question belongs to.
  "quiz_id": 2,
  // The order in which the question will be retrieved and displayed.
  "position": 1,
  // 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.",
  // An array of available answers to display to the student.
  "answers": null
}

An Answer object looks like:

{
  // The unique identifier for the answer.  Do not supply if this answer is part
  // of a new question
  "id": 6656,
  // The text of the answer.
  "answer_text": "Constantinople",
  // An integer to determine correctness of the answer. Incorrect answers should
  // be 0, correct answers should be 100.
  "answer_weight": 100,
  // Specific contextual comments for a particular answer.
  "answer_comments": "Remember to check your spelling prior to submitting this answer.",
  // Used in missing word questions.  The text to follow the missing word
  "text_after_answers": " is the capital of Utah.",
  // Used in matching questions.  The static value of the answer that will be
  // displayed on the left for students to match for.
  "answer_match_left": "Salt Lake City",
  // Used in matching questions. The correct match for the value given in
  // answer_match_left.  Will be displayed in a dropdown with the other
  // answer_match_right values..
  "answer_match_right": "Utah",
  // Used in matching questions. A list of distractors, delimited by new lines (
  // ) that will be seeded with all the answer_match_right values.
  "matching_answer_incorrect_matches": "Nevada
  California
  Washington",
  // Used in numerical questions.  Values can be 'exact_answer', 'range_answer',
  // or 'precision_answer'.
  "numerical_answer_type": "exact_answer",
  // Used in numerical questions of type 'exact_answer'.  The value the answer
  // should equal.
  "exact": 42,
  // Used in numerical questions of type 'exact_answer'. The margin of error
  // allowed for the student's answer.
  "margin": 4,
  // Used in numerical questions of type 'precision_answer'.  The value the answer
  // should equal.
  "approximate": 1234600000.0,
  // Used in numerical questions of type 'precision_answer'. The numerical
  // precision that will be used when comparing the student's answer.
  "precision": 4,
  // Used in numerical questions of type 'range_answer'. The start of the allowed
  // range (inclusive).
  "start": 1,
  // Used in numerical questions of type 'range_answer'. The end of the allowed
  // range (inclusive).
  "end": 10,
  // Used in fill in multiple blank and multiple dropdowns questions.
  "blank_id": 1170
}

GET /api/v1/courses/:course_id/quizzes/:quiz_id/questions

Scope: url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/questions

Returns the paginated list of QuizQuestions in this quiz.

Request Parameters:

Parameter
Type
Description

quiz_submission_id

integer

If specified, the endpoint will return the questions that were presented for that submission. This is useful if the quiz has been modified after the submission was created and the latest quiz version’s set of questions does not match the submission’s. NOTE: you must specify quiz_submission_attempt as well if you specify this parameter.

quiz_submission_attempt

integer

The attempt of the submission you want the questions for.

GET /api/v1/courses/:course_id/quizzes/:quiz_id/questions/:id

Scope: url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/questions/:id

Returns the quiz question with the given id

Request Parameters:

Parameter
Type
Description

id

Required integer

The quiz question unique identifier.

POST /api/v1/courses/:course_id/quizzes/:quiz_id/questions

Scope: url:POST|/api/v1/courses/:course_id/quizzes/:quiz_id/questions

Create a new quiz question for this quiz

Request Parameters:

Parameter
Type
Description

question[question_name]

string

The name of the question.

question[question_text]

string

The text of the question.

question[quiz_group_id]

integer

The id of the quiz group to assign the question to.

question[question_type]

string

The type of question. Multiple optional fields depend upon the type of question to be used.

Allowed values: calculated_question, essay_question, file_upload_question, fill_in_multiple_blanks_question, matching_question, multiple_answers_question, multiple_choice_question, multiple_dropdowns_question, numerical_question, short_answer_question, text_only_question, true_false_question

question[position]

integer

The order in which the question will be displayed in the quiz in relation to other questions.

question[points_possible]

integer

The maximum amount of points received for answering this question correctly.

question[correct_comments]

string

The comment to display if the student answers the question correctly.

question[incorrect_comments]

string

The comment to display if the student answers incorrectly.

question[neutral_comments]

string

The comment to display regardless of how the student answered.

question[text_after_answers]

string

no description

question[answers]

[Answer]

no description

PUT /api/v1/courses/:course_id/quizzes/:quiz_id/questions/:id

Scope: url:PUT|/api/v1/courses/:course_id/quizzes/:quiz_id/questions/:id

Updates an existing quiz question for this quiz

Request Parameters:

Parameter
Type
Description

quiz_id

Required integer

The associated quiz’s unique identifier.

id

Required integer

The quiz question’s unique identifier.

question[question_name]

string

The name of the question.

question[question_text]

string

The text of the question.

question[quiz_group_id]

integer

The id of the quiz group to assign the question to.

question[question_type]

string

The type of question. Multiple optional fields depend upon the type of question to be used.

Allowed values: calculated_question, essay_question, file_upload_question, fill_in_multiple_blanks_question, matching_question, multiple_answers_question, multiple_choice_question, multiple_dropdowns_question, numerical_question, short_answer_question, text_only_question, true_false_question

question[position]

integer

The order in which the question will be displayed in the quiz in relation to other questions.

question[points_possible]

integer

The maximum amount of points received for answering this question correctly.

question[correct_comments]

string

The comment to display if the student answers the question correctly.

question[incorrect_comments]

string

The comment to display if the student answers incorrectly.

question[neutral_comments]

string

The comment to display regardless of how the student answered.

question[text_after_answers]

string

no description

question[answers]

[Answer]

no description

DELETE /api/v1/courses/:course_id/quizzes/:quiz_id/questions/:id

Scope: url:DELETE|/api/v1/courses/:course_id/quizzes/:quiz_id/questions/:id

204 No Content response code is returned if the deletion was successful.

Request Parameters:

Parameter
Type
Description

quiz_id

Required integer

The associated quiz’s unique identifier

id

Required integer

The quiz question’s unique identifier


PreviousQuiz Question GroupsNextQuiz Reports

Last updated 1 month ago

Was this helpful?

Returns a list of objects.

Returns a object.

Returns a object.

Returns a object.

This documentation is generated directly from the Canvas LMS source code, available .

Quizzes::QuizQuestionsController#index
Quizzes::QuizQuestionsController#show
Quizzes::QuizQuestionsController#create
Quizzes::QuizQuestionsController#update
Quizzes::QuizQuestionsController#destroy
on Github
List questions in a quiz or a submission
QuizQuestion
Get a single quiz question
QuizQuestion
Create a single quiz question
QuizQuestion
Update an existing quiz question
QuizQuestion
Delete a quiz question