Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ContentItemUpdateRequest #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/provider.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ class Provider

correct_version = require('./ims-lti').supported_versions.indexOf(body.lti_version) isnt -1
has_resource_link_id = body.resource_link_id?
omits_presentation_lis_params =
not body.launch_presentation_return_url? and
not body.lis_result_sourcedid?

omits_content_item_params =
not body.resource_link_id? and
not body.resource_link_title? and
not body.resource_link_description? and
not body.launch_presentation_return_url? and
not body.lis_result_sourcedid?
not body.resource_link_description?

correct_version and
( body.lti_message_type is 'basic-lti-launch-request' and has_resource_link_id ) or
( body.lti_message_type is 'ContentItemSelectionRequest' and omits_content_item_params )
( body.lti_message_type is 'ContentItemSelectionRequest' and omits_content_item_params and omits_presentation_lis_params ) or
( body.lti_message_type is 'ContentItemUpdateRequest' and omits_presentation_lis_params)

# Helper to validate the OAuth information in the request
#
Expand Down