Embed annotation object in a Canvas page #150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides instructors with a way to embed/insert an annotation assignment object in a Canvas page using the rich content editor. This is something that we know GSE courses have attempted to do in the past manually. Here's a brief demo of how the functionality works.
Changes:
ContentItemSelectionRequest
.middleware.py
to validate aContentItemSelectionRequest
message which is similar to an LTI launch message. This triggers the LTI Content Item Selection Request Workflow (spec).embed_lti
andembed_lti_response
that allow the user to select an annotation object and insert it as an LTI link in the content.EmbedLtiSelectionForm
andEmbedLtiResponseForm
to support the selection of content items and the oauth-signed POST back to the LMS with the selected item.collection_id
andobject_id
as custom GET parameters in addition to POST parameters, which will route directly to the annotation view.Limitations:
launch_lti
view.resource_link_id == context_id
wherecontext_id
is the course-level identifier. This means we can't use the starting resource configuration method of routing learners to a particular assignment object like we do with module items, but instead must pass the assignment and target IDs directly as parameters (collection_id
andobject_id
).notifications
app identifies websocket channels using a combination of(context_id,collection_id,object_id)
, the middleware checks these values against the session, which assumes theresource_link_id
has partitioned the sessions, except it hasn't in this context. So this can result in 403 responses.To test in Canvas:
@lduarte1991 @nmaekawa Let me know if you want to walk through this together since this is a large PR.