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



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


I generated the following xml following Canvas' documentation:


xmlns:xsi="" xsi:schemalocation="">
<blti:title>LTI Content Selection (DEV)</blti:title>
<blti:extensions platform="">
<lticm:property name="tool_id">contentselectiondev</lticm:property>
<lticm:property name="domain"></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"></lticm:property>


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" />




"@context": "",
"@graph": [{
   "@type": "LtiLinkItem",
   "mediaType": "application/vnd.ims.lti.v1.ltilink",
   "url": "",
   "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 "" 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.