QuizGroup

class canvasapi.quiz.QuizGroup(requester, attributes)
Parameters:
  • requester (canvasapi.requester.Requester) – The requester to pass HTTP requests through.
  • attributes (dict) – The JSON object to build this object with.
delete(id)

Get details of the quiz group with the given id.

Calls:DELETE /api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id
Parameters:id (int) – The ID of the question group.
Returns:True if the result was successful (Status code of 204)
Return type:bool
reorder_question_group(id, order, **kwargs)

Update the order of questions within a given group

Calls:

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

Parameters:
  • id (list[dict]) – The ID of the question group.
  • order – A list of dictionaries containing the key ‘id’ of the question to be placed at order’s index.
Returns:

True if the result was successful (Status code of 204)

Return type:

bool

update(id, quiz_groups, **kwargs)

Update a question group given by id.

Calls:

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

Parameters:
  • id (int) – The ID of the question group.
  • quiz_groups (list[dict]) – The name, pick count, and/or question points. All of these parameters are optional, but at least one must exist (even if empty) to recieve a response. The request expects a list, but will only update 1 question group per request.
Returns:

True if the QuizGroup was updated. False otherwise.

Return type:

bool