> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/canvas/resources/quiz_question_groups.md).

# Quiz Question Groups

API for accessing information on quiz question groups

#### A QuizGroup object looks like: <a href="#quizgroup" id="quizgroup"></a>

```js
{
  // The ID of the question group.
  "id": 1,
  // The ID of the Quiz the question group belongs to.
  "quiz_id": 2,
  // The name of the question group.
  "name": "Fraction questions",
  // The number of questions to pick from the group to display to the student.
  "pick_count": 3,
  // The amount of points allotted to each question in the group.
  "question_points": 10,
  // The ID of the Assessment question bank to pull questions from.
  "assessment_question_bank_id": 2,
  // The order in which the question group will be retrieved and displayed.
  "position": 1
}
```

## [List question groups in a quiz](#method.quizzes/quiz_groups.index) <a href="#method.quizzes-quiz_groups.index" id="method.quizzes-quiz_groups.index"></a>

[Quizzes::QuizGroupsController#index](https://github.com/instructure/canvas-lms/blob/master/app/controllers/quizzes/quiz_groups_controller.rb)

#### `GET /api/v1/courses/:course_id/quizzes/:quiz_id/groups`

**Scope:** `url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/groups`

Returns a list of question groups in a quiz.

#### Example Response:

```js
{
  "quiz_groups": [QuizGroup]
}
```

## [Get a single quiz group](#method.quizzes/quiz_groups.show) <a href="#method.quizzes-quiz_groups.show" id="method.quizzes-quiz_groups.show"></a>

[Quizzes::QuizGroupsController#show](https://github.com/instructure/canvas-lms/blob/master/app/controllers/quizzes/quiz_groups_controller.rb)

#### `GET /api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id`

**Scope:** `url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id`

Returns details of the quiz group with the given id.

Returns a [QuizGroup](#quizgroup) object.

## [Create a question group](#method.quizzes/quiz_groups.create) <a href="#method.quizzes-quiz_groups.create" id="method.quizzes-quiz_groups.create"></a>

[Quizzes::QuizGroupsController#create](https://github.com/instructure/canvas-lms/blob/master/app/controllers/quizzes/quiz_groups_controller.rb)

#### `POST /api/v1/courses/:course_id/quizzes/:quiz_id/groups`

**Scope:** `url:POST|/api/v1/courses/:course_id/quizzes/:quiz_id/groups`

Create a new question group for this quiz

\<b>201 Created\</b> response code is returned if the creation was successful.

#### Request Parameters:

| Parameter                                    | Type      | Description                                                    |
| -------------------------------------------- | --------- | -------------------------------------------------------------- |
| `quiz_groups[][name]`                        | `string`  | The name of the question group.                                |
| `quiz_groups[][pick_count]`                  | `integer` | The number of questions to randomly select for this group.     |
| `quiz_groups[][question_points]`             | `integer` | The number of points to assign to each question in the group.  |
| `quiz_groups[][assessment_question_bank_id]` | `integer` | The id of the assessment question bank to pull questions from. |

#### Example Response:

```js
{
  "quiz_groups": [QuizGroup]
}
```

## [Update a question group](#method.quizzes/quiz_groups.update) <a href="#method.quizzes-quiz_groups.update" id="method.quizzes-quiz_groups.update"></a>

[Quizzes::QuizGroupsController#update](https://github.com/instructure/canvas-lms/blob/master/app/controllers/quizzes/quiz_groups_controller.rb)

#### `PUT /api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id`

**Scope:** `url:PUT|/api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id`

Update a question group

#### Request Parameters:

| Parameter                        | Type      | Description                                                   |
| -------------------------------- | --------- | ------------------------------------------------------------- |
| `quiz_groups[][name]`            | `string`  | The name of the question group.                               |
| `quiz_groups[][pick_count]`      | `integer` | The number of questions to randomly select for this group.    |
| `quiz_groups[][question_points]` | `integer` | The number of points to assign to each question in the group. |

#### Example Response:

```js
{
  "quiz_groups": [QuizGroup]
}
```

## [Delete a question group](#method.quizzes/quiz_groups.destroy) <a href="#method.quizzes-quiz_groups.destroy" id="method.quizzes-quiz_groups.destroy"></a>

[Quizzes::QuizGroupsController#destroy](https://github.com/instructure/canvas-lms/blob/master/app/controllers/quizzes/quiz_groups_controller.rb)

#### `DELETE /api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id`

**Scope:** `url:DELETE|/api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id`

Delete a question group

\<b>204 No Content\<b> response code is returned if the deletion was successful.

## [Reorder question groups](#method.quizzes/quiz_groups.reorder) <a href="#method.quizzes-quiz_groups.reorder" id="method.quizzes-quiz_groups.reorder"></a>

[Quizzes::QuizGroupsController#reorder](https://github.com/instructure/canvas-lms/blob/master/app/controllers/quizzes/quiz_groups_controller.rb)

#### `POST /api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id/reorder`

**Scope:** `url:POST|/api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id/reorder`

Change the order of the quiz questions within the group

\<b>204 No Content\<b> response code is returned if the reorder was successful.

#### Request Parameters:

| Parameter       | Type               | Description                                                                  |
| --------------- | ------------------ | ---------------------------------------------------------------------------- |
| `order[][id]`   | Required `integer` | The associated item's unique identifier                                      |
| `order[][type]` | `string`           | The type of item is always 'question' for a group Allowed values: `question` |

***

This documentation is generated directly from the Canvas LMS source code, available [on Github](https://github.com/instructure/canvas-lms).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developerdocs.instructure.com/services/canvas/resources/quiz_question_groups.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
