Quiz

class canvasapi.quiz.Quiz(requester, attributes)
Parameters:
  • requester (canvasapi.requester.Requester) – The requester to pass HTTP requests through.
  • attributes (dict) – The JSON object to build this object with.
create_question_group(quiz_groups, **kwargs)

Create a new question group for the given quiz id

Calls:POST /api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id
Parameters:quiz_groups (list[dict]) – The name, pick count, question points, and/or assessment question bank id. All of these parameters are optional, but at least one must exist (even if empty) to receive a response. The request expects a list, but will only create 1 question group per request.
Returns:QuizGroup object
Return type:canvasapi.quiz_group.QuizGroup
delete(**kwargs)

Delete this quiz.

Calls:DELETE /api/v1/courses/:course_id/quizzes/:id
Return type:canvasapi.quiz.Quiz
edit(**kwargs)

Modify this quiz.

Calls:PUT /api/v1/courses/:course_id/quizzes/:id
Returns:The updated quiz.
Return type:canvasapi.quiz.Quiz
get_quiz_group(id, **kwargs)

Get details of the quiz group with the given id

Calls:GET /api/v1/courses/:course_id/quizzes/:quiz_id/groups/:id
Parameters:id (int) – The ID of the question group.
Returns:QuizGroup object
Return type:canvasapi.quiz_group.QuizGroup