19 October 2012
Open Tapestry supports LTI (Learning Tools Interoperability) integration which allows us to seamlessly link the Dynamic Learning Maps (DLM) system with their remote tool. Open Tapestry provides users with a consumer key and shared secret on registering with their site and these can be used to set up an LTI connection via the OAuth protocol (http://www.oauth.net). Open Tapestry have successfully used this process to integrate with Canvas LMS.
The Idea
If a user had an Open Tapestry account we wanted them to be able to access their snippets from Open Tapestry and use them to create a mash-up resource in DLMs which could then be stored locally. This is similar to how Open Tapestry interact with Canvas LMS.
The Work
Since LTI requires a unique key and secret to make the connection between Open Tapestry and DLMs we started by extending the user profile section of the site to allow uses to enter their key and secret from Open Tapestry. This was simply 2 extra text boxes which the user manually entered their details into.
In order to make the LTI connection we found a Python library ims_lit_py 0.5 which we were able to use. This required 2 dependencies:
This library provided classes for both the ToolConsumer or ToolProvider. However since we were only interested in being a tool consumer we ignored the provider code.
When setting up a ToolConsumer you need to pass in 3 parameters: key, secret and params. key and secret are required, params is not.
tc = ToolConsumer(key, secret)
LTI accepts a number of different parameters which can be used by the tool consumer, but the only ones we chose to pass through (to Open Tapestry) were:
user_id - id of the user in DLMs
launch_presentation_return_url: set to the url of the DLMs website - http:learning-maps.ncl.c.uk
The full code to set up the ToolConsumer looked like this:
key = 'my-key'
secret = 'my-secret'
params = {
'user_id': user_id,
'launch_presentation_return_url': base_path + 'resources/external_content/',
}
tc = ToolConsumer(key, secret, params)
Once you have a ToolConsumer object set up you give it a url and then call the generate_launch_date function to make the LTI connection. This then signs the request using OAuth and returns a dictionary or the parameters.
tc.launch_url = 'http://www.opentapestry.com/lti/items'
result = tc.generate_launch_data()
Once this is done you can make requests to the provider (Open Tapestry) from the consumer (DLMs) by sending the values returned in result (including signature and key) via POST. Because you need to POST the data you couldn't just redirect the user to a url so we did this by creating a form with hidden input boxes for each value held in result and then automatically submitting this form to Open Tapestry.
The process in DLMs worked like this:
Getting Open Tapestry content into DLMs
Open Tapestry had already integrated with Canvas LMS in order to get resources from Open Tapestry into their site so we decided to follow a similar path.
When displaying the users snippets (in Open Tapestry) an insert button is shown below each snippet. This sends the user back to the DLM site where we interegrate the url to get a json representation of the snippet.
An example of the link which points back to the DLMS site is:
http://learning-maps.ncl.ac.uk/public/resources/external_content/?embed_type=oembed&url=http://www.opentapestry.com/items/yht-rZu2S0aNp08GPV6Ciw
?include_attribution=true&endpoint=http://www.opentapestry.com/oembed.json
Related tags: OER, oer phase 3, rapid innovation, supoerglue
Posted by: John Peterson
Posted in: OER phase 3 blog, OER rapid innovation: SupOERGlue