Modules
Modules are collections of learning materials useful for organizing courses and optionally providing a linear flow through them. Module items can be accessed linearly or sequentially depending on module configuration. Items can be unlocked by various criteria such as reading a page or achieving a minimum score on a quiz. Modules themselves can be unlocked by the completion of other Modules.
If any active AssignmentOverrides exist on a ContextModule, then only students who have an applicable override can access the module and are assigned its items. AssignmentOverrides can be created for a (group of) student(s) or a section.
A Module object looks like:
A CompletionRequirement object looks like:
A ContentDetails object looks like:
A ModuleItem object looks like:
A ModuleItemSequenceNode object looks like:
A ModuleItemSequence object looks like:
A ModuleAssignmentOverride object looks like:
An OverrideTarget object looks like:
ContextModulesApiController#index
GET /api/v1/courses/:course_id/modules
GET /api/v1/courses/:course_id/modules
Scope: url:GET|/api/v1/courses/:course_id/modules
A paginated list of the modules in a course
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
|
Allowed values: |
|
| The partial name of the modules (and module items, if ‘items’ is specified with include[]) to match and return. |
|
| Returns module completion information for the student with this id. |
Example Request:
Returns a list of Module objects.
ContextModulesApiController#show
GET /api/v1/courses/:course_id/modules/:id
GET /api/v1/courses/:course_id/modules/:id
Scope: url:GET|/api/v1/courses/:course_id/modules/:id
Get information about a single module
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
|
Allowed values: |
|
| Returns module completion information for the student with this id. |
Example Request:
Returns a Module object.
ContextModulesApiController#create
POST /api/v1/courses/:course_id/modules
POST /api/v1/courses/:course_id/modules
Scope: url:POST|/api/v1/courses/:course_id/modules
Create and return a new module
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | The name of the module |
|
| The date the module will unlock |
|
| The position of this module in the course (1-based) |
|
| Whether module items must be unlocked in order |
|
| IDs of Modules that must be completed before this one is unlocked. Prerequisite modules must precede this module (i.e. have a lower position value), otherwise they will be ignored |
|
| Whether to publish the student’s final grade for the course upon completion of this module. |
Example Request:
Returns a Module object.
ContextModulesApiController#update
PUT /api/v1/courses/:course_id/modules/:id
PUT /api/v1/courses/:course_id/modules/:id
Scope: url:PUT|/api/v1/courses/:course_id/modules/:id
Update and return an existing module
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The name of the module |
|
| The date the module will unlock |
|
| The position of the module in the course (1-based) |
|
| Whether module items must be unlocked in order |
|
| IDs of Modules that must be completed before this one is unlocked Prerequisite modules must precede this module (i.e. have a lower position value), otherwise they will be ignored |
|
| Whether to publish the student’s final grade for the course upon completion of this module. |
|
| Whether the module is published and visible to students |
Example Request:
Returns a Module object.
ContextModulesApiController#destroy
DELETE /api/v1/courses/:course_id/modules/:id
DELETE /api/v1/courses/:course_id/modules/:id
Scope: url:DELETE|/api/v1/courses/:course_id/modules/:id
Delete a module
Example Request:
Returns a Module object.
ContextModulesApiController#relock
PUT /api/v1/courses/:course_id/modules/:id/relock
PUT /api/v1/courses/:course_id/modules/:id/relock
Scope: url:PUT|/api/v1/courses/:course_id/modules/:id/relock
Resets 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.
Example Request:
Returns a Module object.
ContextModuleItemsApiController#index
GET /api/v1/courses/:course_id/modules/:module_id/items
GET /api/v1/courses/:course_id/modules/:module_id/items
Scope: url:GET|/api/v1/courses/:course_id/modules/:module_id/items
A paginated list of the items in a module
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| If included, will return additional details specific to the content associated with each item. Refer to the Module Item specification for more details. Includes standard lock information for each item. Allowed values: |
|
| The partial title of the items to match and return. |
|
| Returns module completion information for the student with this id. |
Example Request:
Returns a list of ModuleItem objects.
ContextModuleItemsApiController#show
GET /api/v1/courses/:course_id/modules/:module_id/items/:id
GET /api/v1/courses/:course_id/modules/:module_id/items/:id
Scope: url:GET|/api/v1/courses/:course_id/modules/:module_id/items/:id
Get information about a single module item
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| If included, will return additional details specific to the content associated with this item. Refer to the Module Item specification for more details. Includes standard lock information for each item. Allowed values: |
|
| Returns module completion information for the student with this id. |
Example Request:
Returns a ModuleItem object.
ContextModuleItemsApiController#create
POST /api/v1/courses/:course_id/modules/:module_id/items
POST /api/v1/courses/:course_id/modules/:module_id/items
Scope: url:POST|/api/v1/courses/:course_id/modules/:module_id/items
Create and return a new module item
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The name of the module item and associated content |
| Required | The type of content linked to the item Allowed values: |
| Required | The id of the content to link to the module item. Required, except for ‘ExternalUrl’, ‘Page’, and ‘SubHeader’ types. |
|
| The position of this item in the module (1-based). |
|
| 0-based indent level; module items may be indented to show a hierarchy |
|
| Suffix for the linked wiki page (e.g. ‘front-page’). Required for ‘Page’ type. |
|
| External url that the item points to. [Required for ‘ExternalUrl’ and ‘ExternalTool’ types. |
|
| Whether the external tool opens in a new tab. Only applies to ‘ExternalTool’ type. |
|
| Completion requirement for this module item. “must_view”: Applies to all item types “must_contribute”: Only applies to “Assignment”, “Discussion”, and “Page” types “must_submit”, “min_score”: Only apply to “Assignment” and “Quiz” types “must_mark_done”: Only applies to “Assignment” and “Page” types Inapplicable types will be ignored Allowed values: |
|
| Minimum score required to complete. Required for completion_requirement type ‘min_score’. |
|
| Width of the ExternalTool on launch |
|
| Height of the ExternalTool on launch |
Example Request:
Returns a ModuleItem object.
ContextModuleItemsApiController#update
PUT /api/v1/courses/:course_id/modules/:module_id/items/:id
PUT /api/v1/courses/:course_id/modules/:module_id/items/:id
Scope: url:PUT|/api/v1/courses/:course_id/modules/:module_id/items/:id
Update and return an existing module item
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The name of the module item |
|
| The position of this item in the module (1-based) |
|
| 0-based indent level; module items may be indented to show a hierarchy |
|
| External url that the item points to. Only applies to ‘ExternalUrl’ type. |
|
| Whether the external tool opens in a new tab. Only applies to ‘ExternalTool’ type. |
|
| Completion requirement for this module item. “must_view”: Applies to all item types “must_contribute”: Only applies to “Assignment”, “Discussion”, and “Page” types “must_submit”, “min_score”: Only apply to “Assignment” and “Quiz” types “must_mark_done”: Only applies to “Assignment” and “Page” types Inapplicable types will be ignored Allowed values: |
|
| Minimum score required to complete, Required for completion_requirement type ‘min_score’. |
|
| Whether the module item is published and visible to students. |
|
| Move this item to another module by specifying the target module id here. The target module must be in the same course. |
Example Request:
Returns a ModuleItem object.
ContextModuleItemsApiController#select_mastery_path
POST /api/v1/courses/:course_id/modules/:module_id/items/:id/select_mastery_path
POST /api/v1/courses/:course_id/modules/:module_id/items/:id/select_mastery_path
Scope: url:POST|/api/v1/courses/:course_id/modules/:module_id/items/:id/select_mastery_path
Select a mastery path when module item includes several possible paths. Requires Mastery Paths feature to be enabled. Returns a compound document with the assignments included in the given path and any module items related to those assignments
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Assignment set chosen, as specified in the mastery_paths portion of the context module item response |
|
| Which student the selection applies to. If not specified, current user is implied. |
Example Request:
ContextModuleItemsApiController#destroy
DELETE /api/v1/courses/:course_id/modules/:module_id/items/:id
DELETE /api/v1/courses/:course_id/modules/:module_id/items/:id
Scope: url:DELETE|/api/v1/courses/:course_id/modules/:module_id/items/:id
Delete a module item
Example Request:
Returns a ModuleItem object.
ContextModuleItemsApiController#mark_as_done
PUT /api/v1/courses/:course_id/modules/:module_id/items/:id/done
PUT /api/v1/courses/:course_id/modules/:module_id/items/:id/done
Scope: url:PUT|/api/v1/courses/:course_id/modules/:module_id/items/:id/done
Mark a module item as done/not done. Use HTTP method PUT to mark as done, and DELETE to mark as not done.
Example Request:
ContextModuleItemsApiController#item_sequence
GET /api/v1/courses/:course_id/module_item_sequence
GET /api/v1/courses/:course_id/module_item_sequence
Scope: url:GET|/api/v1/courses/:course_id/module_item_sequence
Given an asset in a course, find the ModuleItem it belongs to, the previous and next Module Items in the course sequence, and also any applicable mastery path rules
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The type of asset to find module sequence information for. Use the ModuleItem if it is known (e.g., the user navigated from a module item), since this will avoid ambiguity if the asset appears more than once in the module sequence. Allowed values: |
|
| The id of the asset (or the url in the case of a Page) |
Example Request:
Returns a ModuleItemSequence object.
ContextModuleItemsApiController#mark_item_read
POST /api/v1/courses/:course_id/modules/:module_id/items/:id/mark_read
POST /api/v1/courses/:course_id/modules/:module_id/items/:id/mark_read
Scope: url:POST|/api/v1/courses/:course_id/modules/:module_id/items/:id/mark_read
Fulfills “must view” requirement for a module item. It is generally not necessary to do this explicitly, but it is provided for applications that need to access external content directly (bypassing the html_url redirect that normally allows Canvas to fulfill “must view” requirements).
This endpoint cannot be used to complete requirements on locked or unpublished module items.
Example Request:
ModuleAssignmentOverridesController#index
GET /api/v1/courses/:course_id/modules/:context_module_id/assignment_overrides
GET /api/v1/courses/:course_id/modules/:context_module_id/assignment_overrides
Scope: url:GET|/api/v1/courses/:course_id/modules/:context_module_id/assignment_overrides
Returns a paginated list of AssignmentOverrides that apply to the ContextModule.
Example Request:
Returns a list of ModuleAssignmentOverride objects.
ModuleAssignmentOverridesController#bulk_update
PUT /api/v1/courses/:course_id/modules/:context_module_id/assignment_overrides
PUT /api/v1/courses/:course_id/modules/:context_module_id/assignment_overrides
Scope: url:PUT|/api/v1/courses/:course_id/modules/:context_module_id/assignment_overrides
Accepts a list of overrides and applies them to the ContextModule. Returns 204 No Content response code if successful.
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | List of overrides to apply to the module. Overrides that already exist should include an ID and will be updated if needed. New overrides will be created for overrides in the list without an ID. Overrides not included in the list will be deleted. Providing an empty list will delete all of the module’s overrides. Keys for each override object can include: ‘id’, ‘title’, ‘student_ids’, and ‘course_section_id’. |
Example Request:
© Instructure, Inc. Generated on Wed Nov 6 14:20:08 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated