LTI and Moodle

External Tool LTI content-item message

 
Picture of Adrian Cheung
External Tool LTI content-item message
 

Hello,

I tried to use the external tool to get a content list for selection by the LTI content-item message, but when I click the 'Select content' button it always gives the 'Invalid Content-Item response format' message. I have verified the message with the LTI emulator (http://ltiapps.net/test/tc.php) before and it looks ok (see attached). Anyone knows what's wrong with the format or it should be something else for the select content button?

Adrian


 
Average of ratings: -
Picture of John Okely
Re: External Tool LTI content-item message
Core developersParticularly helpful MoodlersPlugin developersTesters

What LTI provider are you using? If the url you entered is not an LTI provider it will not give a correct content-item response.

If you are just interested to try it out, you can use the tool provider emulator http://lti.tools/test/tp.php

If you are using a tool, it may be a problem with the tool

 
Average of ratings: -
Picture of Adrian Cheung
回應: External Tool LTI content-item message
 

So... I found out that moodle only accepts one item returned in the 'content_items' field, where (it seems?) in the LTI spec (http://www.imsglobal.org/specs/lticiv1p0/specification-3) you can return multiple items in the content_item response.

 
Average of ratings: -
Picture of John Okely
Re: 回應: External Tool LTI content-item message
Core developersParticularly helpful MoodlersPlugin developersTesters

That is definitely a bug. Are you able to create a bug report on tracker.moodle.org?

 
Average of ratings: -
Picture of Adrian Cheung
回應: External Tool LTI content-item message
 

I would like to know, is it that moodle's implementation expected to accept one item returned only? Cos it seems just to use the content item returned to configure the current external tools settings (with some custom parameters maybe).

 
Average of ratings: -
Picture of John Okely
Re: 回應: External Tool LTI content-item message
Core developersParticularly helpful MoodlersPlugin developersTesters

Yes, well as far as I'm aware it just uses the first one. And yes, configuration only.

 
Average of ratings: -
Picture of Adrian Cheung
回應: External Tool LTI content-item message
 

I registered the tool with membership service enabled, and I am able to retrieve the users list when using basic-lti-launch-request. However when I use the content-item selection, /mod/lti/contentitem.php throws a 404 error and no error log can be found. (I enabled all capabilities and tool settings parameters for both basic-lti-launch-request and ContentItemSelectionRequest like this):

            array(
                'tc_profile_url'            => 'ToolConsumerProfile.url',
                'system_setting_url'        => 'ToolProxy.custom.url',
                'context_setting_url'        => 'ToolProxyBinding.custom.url',
                'link_setting_url'            => 'LtiLink.custom.url',
                'context_memberships_url'    => 'ToolProxyBinding.memberships.url',
            )


By the way, I alwyas get the following js error in the External tool registration result page, no matter registration is success or not. I believe this looks like to be a bug:

Uncaught TypeError: window.parent.triggerExternalRegistrationComplete is not a function
    at Object.init (first.js:87)
    at externalregistrationreturn.php?id=21&sesskey=fhTwJKfhoD&lti_errormsg=Sorry%2C+there+was+an+error+co…:147
    at Object.execCb (require.min.js:1)
    at b.check (require.min.js:1)
    at b.enable (require.min.js:1)
    at b.init (require.min.js:1)
    at require.min.js:1


 
Average of ratings: -
Picture of John Okely
Re: 回應: External Tool LTI content-item message
Core developersParticularly helpful MoodlersPlugin developersTesters

Feel free to create an issue about the triggerExternalRegistrationComplete error.

As for the content item 404, did you check your web server logs?

You can compare your content item request to a moodle to moodle one as a starting point. See if anything is missing

 
Average of ratings: -