Deep Linking
Using Deep Linking to Select Resources
Introduction
Deep Linking (formerly named Content-Item) is an extension to LTI that allows data to be passed back to the Tool Consumer (i.e., Canvas) in context of an LTI Launch. A few common use cases are:
Providing a teacher the ability to select a customized LTI launch link from the tool provider to be placed in the tool consumer.
Allowing a student to submit an attachment for an assignment that is provided by a tool provider (i.e., the external tool).
Embedding custom content into a rich text editor from a tool provider.
Providing a teacher the ability to select a customized LTI launch link from the tool and include grading information with it, which is used to create an assignment directly from the tool.
Using an external tool to create multiple pieces of content directly from, the tool, whether ungraded (like module items), or graded (like assignments), and return them to Canvas in bulk.
Deep Linking is supported in the LTI 1.1 Outcomes Service and LTI Advantage specifications. To see the full spec for content item and other code examples see these documents:
Deep Linking is not applicable to all placements in Canvas, but can be used with the following placements:
editor_button: Allows users that have access to the Canvas Rich Content Editor to select a variety of content types from the tool and embed them directly in the editor.
homework_submission: Allows students to select a resource from the external tool for assignments that are set up as File Upload submission types.
migration_selection: Allows users that have permission to import course content to launch to a tool to select a file (ex: a common cartridge file) from a tool and have it imported into the course.
assignment_selection: Allows users that have permission to create assignments to launch to a tool, select a deep link, and return it as an External Tool submission type.
link_selection: Allows users that have permission to create module items to launch to a tool, select a deep link, and return it as a module item.
The following placements support deep linking with LTI 1.3/Advantage tools, but not with LTI 1.1 tools:
course_assignments_menu: Appears in the dropdown menu in the top right of the assignments page. Allows users that have permission to create module items to launch to a tool, select one or many deep links, and return them as module items or assignments.
module_index_menu_modal: Appears in the dropdown menu in the top right of the modules page. Allows users that have permission to create module items to launch to a tool, select one or many deep links, and return them as module items or assignments. Adds all returned deep links to a newly created module.
This document will continue referring to this process as "Content-Item" for LTI 1.1 and Deep Linking for LTI Advantage.
LTI Advantage Deep Linking Process
LTI Advantage tools can be configured in Canvas to send an LTI launch request with a deep linking message type for certain placements. The specific details of a deep linking interaction are best presented in the IMS LTI Deep Linking specification. Instead this section will focus on tool configuration.
Supported Content Item Types
The IMS LTI Deep Linking specification defines several content items types that a tool may return to the platform via Deep linking. Canvas supports all of these content item types and their respective required properties with additional support for the optional properties listed here:
File
Full support for require properties.
Support for the following optional properties:
text (should be filename)
Link
Full support for required properties.
Support for the following optional properties:
title
text
icon
thumbnail
iframe
LTI Resource Link
Full support for required properties.
Support for the following optional properties:
url
title
text
icon
thumbnail
iframe
custom (allows for setting link-specific LTI launch parameters. See documentation here.)
lineItem
available
submission (except
startDateTime
)
Line Items
If a returned content item has the lineItem
property, then it is used to create a new assignment, instead of a normal LTI link. The available
and submission
properties are also used for the assignment unlock, lock, and due dates. Note that since Canvas has no notion of a start date for submissions, it ignores the submission.startDateTime
sub-property.
There are only 3 places that support assigment creation using Line Items, and each of them respond differently:
assignment_selection: creates an assignment using the given data and presents it to the user for further editing.
course_assignments_menu: creates one or many assignments from the given Line Items. If any given content items do not have the
lineItem
property, a new module is created and they are added to it as new module items.module_index_menu_modal: creates a new module and adds all given content items to it as either module items or assignments, based on the presence or absence of the
lineItem
property.
Assignment Selection Deep Linking
When a tool is launched from the assignment_selection
placement, any previous LTI parameters (URL, iframe width, etc.) are overwritten with the information in the Deep Linking Response. In addition, if the following properties are present and non-empty in the content item in the Deep Linking Response, they will set the following fields, potentially overwriting user-inputted values:
text
sets/overwrites the assignment descriptionlineItem.scoreMaximum
sets/overwrites the maximum score for the assignmentlineItem.label
ortitle
sets the assignment name, and overwrites unless"https://canvas.instructure.com/lti/preserveExistingAssignmentName": true
is given in the content item.
HTML fragment
Full support for required properties.
Full support for all optional properties.
Image
Full support for required properties.
Support for the following optional properties:
title
text
thumbnail
width
height
Configuring Deep Linking
Deep linking is configured by creating a Canvas LTI Developer Key with a LtiDeepLinkingRequest
message type set on a supported placement. This can be done via the UI, or by supplying Canvas with JSON.
For example, the following JSON would allow an LTI Advantage tool to be installed that uses deep linking return items back to Canvas as an assignment or within the canvas Rich Content Editor:
Once the developer key is configured, it can then be used to install the LTI tool. Links will then be exposed in the Canvas Rich Content Editor toolbar and Assignment edit view. Clicking the links will then initiate a deep linking LTI workflow to allow the user to select a resource from the tool and have them embedded in Canvas.
LTI 1.1 Content-Item Process
The first step in the content-item process is the sending of the ContentItemSelectionRequest
message from the Tool Consumer to the Tool Provider. An example message is included below:
ContentItemRequest: Tool Consumer -> Tool Provider
Some of the important parameters are: accept_media_types, accept_presentation_document_targets, and content_item_return_url.
accept_media_types is a comma separated list of MIME types the Tool Consumer supports.
accept_presentation_document_targets is a comma separated list of presentation formats the Tool Consumer supports.
content_item_return_url is where the tool provider should redirect to at the end of the content-item process.
After the Tool Provider receives the ContentItemSelectionRequest
message it will need to send back a ContentItemSelection
message that includes the content-items
they wish to send back. An example of this message is shown below:
ContentItemSelection: Tool Consumer <- Tool Provider
The main points of interest here is the content_items
parameter. It contains a JSON object that includes an array of content-item objects. Inside the JSON object, the @graph
object contains an array that holds all of the content-item objects.
The content-item object in this example is sending back a single LTI link that is to be launched in the current frame. the url
specifies the lti launch point , and the mediaType
specifies that it is an lti launch.
Configuring Content-item
To use content-item, the tool provider must be configured correctly. The following is an overview of how to configure the tool provider to use content-item.
LTI Tool XML Configuration
Below is an example of a bare-bones tool provider LTI configuration that does not use content-item:
Note: for more on the basics of LTI tool configuration see external tools documentation.
To begin using content-item we need to specify at least one valid placement for Canvas to use. Placements are used to help the tool consumer (Canvas in this case) know where the tool should be placed within the LMS. For example, adding the following node as a child of the blti:extensions element in the above XML would tell Canvas to add a link in the course navigation to the LTI tool:
For our example we will use assignment_selection.
To enable content-item with the assignment_selection placement, we add lines 6-9 to the example from above:
Adding the element on line 6 lets Canvas know the tool should be placed in the assignments menu. Line 7 tells Canvas the tool is using content-item, and line 8 provides Canvas the launch URL.
© Instructure, Inc. Generated on Wed Nov 6 14:19:59 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated