LTI Message Handler
- Moodle 1.9–5.1
- 更新 2020-04-04
This Moodle LTI Source plugin allows communication between an LTI tool and a consumer site.
LTI Message Handler
by Western Canadian Learning Network.
This Moodle LTI Source plugin allows communication between an LTI tool and a consumer site. It is meant to replicate message handling functions implemented in Canvas. Thus, if an LTI provider makes use of Canvas’ functions, this plugin will work similarly.
The main purpose of this plugin is to allow iFrame resizing. The LTI iFrames in Moodle are laughably small and impossible to view course content in. With this plugin installed, an LTI tool provider may send messages to the tool consumer instructing it
to resize the iFrame.
See the screenshots which show an LTI book with and without this plugin installed.
Installation:
This plugin should be installed on the tool consumer site. See “Usage” for how to make use of this plugin as a tool provider.
Extract the ZIP to ‘mod/lti/source/’.
The folder name within the source directory should be “message_handler”.
Login to your Moodle site as an administrator and install the plugin.
or
Login to your Moodle site as an admin and go to Administration -> Site administration -> Plugins -> Install plugins.
Upload the ZIP file.
Usage:
Once the plugin is installed on the tool consumer site, the tool provider may communicate with it as follows.
// Send message to the tool consumer to resize the iframe. Height will be accepted as an integer or a string.
window.parent.postMessage(JSON.stringify({subject: ‘lti.frameResize’, height: 1000}), ‘*’);
// Send message to the tool consumer to resize the iframe.