Remote plugins & the BookWidget sample
Posted: 2013/02/15 Filed under: Uncategorized | Tags: LTI, remote-plugins, Sample, Valence 6 Comments »The Challenge
A Desire2Learn Learning Environment administrator can install applications to offer greater functionality or streamline common processes for their users. However, there is some overhead involved in performing software updates to install these applications on the Learning Management System. Logically, reducing this installation overhead can reduce a barrier to adoption of an application.
The Solution
A remote plugin can extend the functionality of the LMS without requiring additional software. The remote plugin object has a rich content connection with the LMS, and provides UI elements that the developer can control. Using the BookWidget as an example, we will introduce some of the functionality that is possible through remote plugins and demonstrate the ease of building and deploying them.
The BookWidget is designed to allow an instructor to select textbooks to associate with their courses. Instructors can search by ISBN, title, or author to locate textbooks, and add or remove textbooks for each course they manage.
Students are presented with a user-friendly interface to determine which textbooks they need to acquire, including a thumbnail of the cover, and key information such as title and author. Where applicable, the BookWidget also provides students with a link to purchase textbooks from online retailers.
The Details
Remote plugin widgets are hosted separately from the LMS, which allows them to be enabled without performing software updates to the LMS. They take advantage of the Learning Tools Interoperability (LTI) specification to connect to the LMS. Once connected, the Valence Learning Framework APIs take over to provide interactivity with the LMS. The BookWidget sample is a VisualStudio 2010 project, which is available to download from our public code repository.
A remote plugin widget loads within an iframe embedded in a course homepage. When a student or instructor loads a page that contains a remote plugin widget, the widget issues an LTI launch request, which results in a POST to the URL configured as the target for the remote plugin widget. The POST contains a set of fields described in the LTI documentation. Once the widget extracts these fields from the POST data, it generates the application context to create the appropriate LTI authorization parameters. The LTI authentication takes place using OAuth, which uses a shared key and secret between the remote plugin and the widget code. The widget then redirects to the generated authentication URL. After authentication is completed, the widget reloads at its launch URL.
Once the LTI launch is complete, the remote plugin widget uses the Learning Framework APIs to perform actions against the LMS. For the BookWidget, this includes retrieving and manipulating information related to the books assigned to a particular course. The BookWidget uses an HTTP POST to the appropriate route to associate a book with a course. It uses an HTTP DELETE to remove a book from a course. And it uses an HTTP GET to retrieve the list of associated books for a course. When we developed the BookWidget, we identified the Learning Framework APIs we needed and then tested them interactively to ensure they behaved as we expected. We performed this interactive testing using the Getting Started Sample. Then we built those routes into the BookWidget application.
Because a remote plugin is hosted separately from the LMS, it does not inherit the look and feel of the course homepage. It is not yet possible to retrieve LMS CSS information using the APIs, so the BookWidget uses a simple design with minimal embellishments to allow it to blend in with the LMS styles. The sample was built using Bootstrap to help make styling easier.
The Sample
Setting up the BookWidget in your own environment demonstrates how easy it is to deploy a remote plugin.
- Download the current version of the BookWidget sample. The sample requires Visual Studio 2010.
- Log in to the Learning Environment as an administrator.
- Click on the Admin Tools icon and click Remote Plugins.
- Click on the New Remote Plugin button and fill out the Launch Point and Name. In this example, the Launch Point is the URL of the running instance of the BookWidget. If running the sample from Visual Studio it will likely be “
http://localhost:6371/books
“. - Change the Plugin Type dropdown to Widget.
- Add the Org Units that will have permission to run the BookWidget by clicking the Add Org Units button.
- Click Save.
Once the BookWidget is configured, an instructor can add it to their course homepage and start using it.
The Result
As we’ve demonstrated, a remote plugin provides LMS users with additional functionality without the overhead of software updates. The BookWidget sample demonstrates how a remote plugin can use LTI and the Learning Framework APIs to offer a rich user experience.
Try the BookWidget sample in your own environment. Share your experience implementing and extending this sample in the comments. If you create your own remote plugins, be sure to let us know. We’d love to feature your work in a future blog post!




Great post Sara-Beth!
Good post. Do you know how a remote plugin is supposed to be used in the context of the CourseBuilder?
We’d like to use a remote plugin to configure a custom LTI external learning tool link via the course builder.
i.e. when the user adds an instance of the remote plugin to a module using the Course Builder, our plugin will display a UI to configure a specific instance of the our LTI tool. When the instructors has finished configuring the instance through our plugin UI, we’d like an External Learning Tool link to be created at the location in the module where the plugin was dropped. Then when the student clicks on the module link they will see the external learning tool rather than the plugin UI.
It’s possible we might be able to use the Valence API to create the link when our Plugin UI is executed in a similar way to how the Book Widget example adds books to the course. However, I’m not sure how we would know exactly where to create the link or if it is even possible to create LTI external tool links using the Valence API.
Also, when you use a plugin in the course builder you can drag the plugin to a specific location in the module e.g. between 2 existing items. I don’t see anything in the LTI launch parameters when the plugin is executed that tells us where that is apart from this parameter:
custom_links_import_service_url:https://mydomain.desire2learndemo.com/d2l/lms/remoteplugins/coursebuilder/ImportService.d2l?parentNode=541&pluginId=85834c62-3fc6-455d-b89a-e99bbf70f1ce
That URL has the node of the module (parentNode=541) but doesn’t tell us where in the module the plugin was placed.
The launch also includes a return URL parameter but returning to that just seems to refresh the page, and not even the original plugin launch url is added to the module.
I see the text “Insert action was cancelled.” at the top of the popup and the course builder refreshes.
launch_presentation_return_url:https://mydomain.desire2learndemo.com/d2l/lms/remoteplugins/courseBuilder/return.d2l?ou=6671&parentNode=541&pluginId=85834c62-3fc6-455d-b89a-e99bbf70f1ce
Hope this description of what we’d like to do makes sense, and thanks for any insights.
One other question related to remote plugins….
Are course builder remote plugins only available from the “Course Builder UI”
It would be cool if they were available from the default content building UI, e.g. via Add Activities > Insert a Quicklink
Thanks
Glad you enjoyed the post, Martin. Thanks very much for the response – great questions! Would you mind posting your question on StackOverflow.com so that we can share this question and the answers with the wider community? Be sure to tag your question as desire2learn so that anyone following that tag will see the question come in and have the opportunity to respond.
Link to question on StackOverflow: http://stackoverflow.com/questions/15284305/can-a-desire2learn-remote-plugin-be-used-to-insert-a-custom-external-learning-to
[...] Remote plugins & the BookWidget sample → [...]