Module

class canvasapi.module.Module(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_module_item(module_item, **kwargs)

Create a module item.

Calls:POST /api/v1/courses/:course_id/modules/:module_id/items
Parameters:module_item (dict) – The attributes to create the module item with.
Returns:The created module item.
Return type:canvasapi.module.ModuleItem
delete()

Delete this module.

Calls:DELETE /api/v1/courses/:course_id/modules/:id
Return type:canvasapi.module.Module
edit(**kwargs)

Update this module.

Calls:PUT /api/v1/courses/:course_id/modules/:id
Return type:canvasapi.module.Module
get_module_item(module_item, **kwargs)

Retrieve a module item by ID.

Calls:GET /api/v1/courses/:course_id/modules/:module_id/items/:id
Parameters:module_item (canvasapi.module.ModuleItem or dict) – The object or ID of the module item.
Return type:canvasapi.module.ModuleItem
get_module_items(**kwargs)

List all of the items in this module.

Calls:GET /api/v1/courses/:course_id/modules/:module_id/items
Return type:canvasapi.paginated_list.PaginatedList of canvasapi.module.ModuleItem
relock()

Reset module progressions to their default locked state and recalculates them based on the current requirements.

Adding progression requirements to an active course will not lock students out of modules they have already unlocked unless this action is called.

Calls:PUT /api/v1/courses/:course_id/modules/:id/relock
Return type:canvasapi.module.Module

ModuleItem

class canvasapi.module.ModuleItem(requester, attributes)
Parameters:
  • requester (canvasapi.requester.Requester) – The requester to pass HTTP requests through.
  • attributes (dict) – The JSON object to build this object with.
complete()

Mark this module item as done.

Calls:PUT /api/v1/courses/:course_id/modules/:module_id/items/:id/done
Return type:canvasapi.module.ModuleItem
delete()

Delete this module item.

Calls:DELETE /api/v1/courses/:course_id/modules/:module_id/items/:id
Return type:canvasapi.module.ModuleItem
edit(**kwargs)

Update this module item.

Calls:PUT /api/v1/courses/:course_id/modules/:module_id/items/:id
Returns:The updated module item.
Return type:canvasapi.module.ModuleItem
uncomplete()

Mark this module item as not done.

Calls:DELETE /api/v1/courses/:course_id/modules/:module_id/items/:id/done
Return type:canvasapi.module.ModuleItem