AnsweredAssumed Answered

LTI ContentItemSelection Custom Parameters/ Homework submission

Question asked by Andre Seibert on Apr 11, 2018
Latest reply on Apr 19, 2018 by Andre Seibert

Hello,

 

I am extending an existing LTI app to appropriately handle "ContentItemSelectionRequest". 

 

I generated the following xml following Canvas' documentation:

 

<cartridge_basiclti_link
xmlns="http://www.imsglobal.org/xsd/imslticc_v1p0"
xmlns:blti="http://www.imsglobal.org/xsd/imsbasiclti_v1p0"
xmlns:lticm="http://www.imsglobal.org/xsd/imslticm_v1p0"
xmlns:lticp="http://www.imsglobal.org/xsd/imslticp_v1p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0p1.xsd http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd">
<blti:title>LTI Content Selection (DEV)</blti:title>
<blti:launch_url>https://dev.site.com/blti</blti:launch_url>
<blti:custom></blti:custom>
<blti:extensions platform="canvas.instructure.com">
<lticm:property name="tool_id">contentselectiondev</lticm:property>
<lticm:property name="domain">site.com</lticm:property>
<lticm:property name="privacy_level">public</lticm:property>
<lticm:property name="oauth_compliant">true</lticm:property>
<lticm:property name="windowTarget">_blank</lticm:property>
<lticm:options name="assignment_selection">
<lticm:property name="message_type">ContentItemSelectionRequest</lticm:property>
<lticm:property name="enabled">true</lticm:property>
<lticm:property name="url">https://dev.site.com/blti</lticm:property>
</lticm:options>
</blti:extensions>
</cartridge_basiclti_link>

 

I created a new assignment and selected the above xml as the external tool submission type. This immediately fires an lti request. I see both the "content_item_return_url" and the correct "lti_message_type". After the user selects the assignment this form is submitted:

 

<form method="post" action={ value from lti content_item_return_url parameter } id="lti-content-form" encType="application/x-www-form-urlencoded">
<input type="hidden" name="data" value={ value from lti data parameter } />
<input type="hidden" name="lti_message_type" value="ContentItemSelection" />
<input type="hidden" name="lti_version" value="LTI-1p0" />
<input type="hidden" name="content_items" value=CotentItemJson" />
</form>

 

ContentItemJson:

 

{
"@context": "http://purl.imsglobal.org/ctx/lti/v1/ContentItem",
"@graph": [{
   "@type": "LtiLinkItem",
   "mediaType": "application/vnd.ims.lti.v1.ltilink",
   "url": "https://dev.site.com/blti",
   "custom": {
      "assignment_id": "1"
   }
   }]
}

Problem 1:

 

When the student clicks on the assignment it isn't passing the custom parameter I added.  I can add it to the url "https://dev.site.com/blti?custom_assignment_id=1" but I believe the above json should work. I've tried changing the url, encoding the json string, passing different parameters but the only item that Canvas ever updates is the url. 

 

Problem 2: 

 

When the student clicks on the link I need it to pass "ext_content_intended_use" and its value should be "homework". I'd also need the parameter "ext_content_return_url" and its value. These parameters get passed when coming from a homework submission tab. The problem is the faculty/course creator needs to first select the assignment in our system (problem 1 -> custom_assignment_id) that way when the student clicks on the link it takes them directly to the assignment for completion. Once they are done they should be able to submit it back to Canvas. 

 

 

Any help would be appreciated. 

Outcomes