Embedding an LTI resource/activity inside a page resource

Embedding an LTI resource/activity inside a page resource

by Acqua Alta -
Number of replies: 2
Picture of Particularly helpful Moodlers

Hi,
Let's say that I have an LTI activity in a Moodle course, and I want to embed it in a Moodle Page resource. Can it be done?

The reason that I want to do this is that I want to write some instructions, then have the LTI embedded in the page after the instructions. And I want everything to be on the same page, and not on the main course page.

Please share your knowledge about this topic.

Thanks smile

Average of ratings: -
In reply to Acqua Alta

Re: Embedding an LTI resource/activity inside a page resource

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Acqua,

I can think of at least one way this might be possible but it's essentially a workaround right now. What we really want is something like Tiny MCE support for LTI - see MDL-67560 for that feature (it's not ready quite yet though).

The workaround, works like so:
1) Stealth activities need to be enabled at site level.
2) Teachers must have enough knowledge of HTML to create an iframe in the page activity settings
3) The iframe must use a src with syntax equal to "mod/lti/launch.php?id=x". This isn't a URL that's generally publicly available via the link to the activity in the course (that link is mod/lti/view.php?id=x)

Essentially, this allows the LTI activity to be hidden but still available to students. Then, using the HTML editor on the page's "page content", the teacher can insert an iframe with src set to the URL of the stealth activity's launch URL. See below for an example of this:

example of the workaround allowing LTI embeds in page resources
In reply to Jake Dallimore

Re: Embedding an LTI resource/activity inside a page resource

by Acqua Alta -
Picture of Particularly helpful Moodlers
Hi Jake,
Thank you very much for your detailed answer and the time and effort that you put into it smile