Hide
Prerequisites
- You need two moodle sites (localhost is fine) - one called 'platform' and one called 'tool'
- For BOTH sites, go to admin and remove all entries from "curlsecurityblockedhosts", saving the setting.
- The platform site should contain a course with:
- A teacher t1
- A few students (s1, s2)
- The tool site should contain a course with:
- A teacher t1
- An assignment (using defaults is fine)
- A file resource (anything is fine)
- In the tool site admin settings:
- Enable enrol_lti and auth_lti plugins
- Enable "Allow frame embedding"
Coexistence
This test confirms that we're able to register a tool site over LTI Advantage and launch into resources and activities over BOTH LTI 1.1 and LTI Advantage - aka the new and old tools can coexist. This is the preferred method of setting up LTI Advantage with Moodle consumers (i.e. Moodle to Moodle), since Moodle platforms use a single deployment model, and thus don't suit the consumer key based upgrade path very well.
- First we want to set up a 1.1 tool and launch it. In the tool site, go to a course
- Under 'Participants' > 'Enrolment methods' select 'Publish as LTI tool' from the "Add method" list
- Change the LTI version to "Legacy LTI"
- Enter an instance name
- Select an activity to be published (assignment is fine)
- Leave everything else on defaults
- Save
- Access "Published as LTI tools" via the course admin and under the "Legacy LTI" tab, note the "Launch URL" and "Secret" (leave this tab open)
- Now, in another browser session log in to the platform site.
- Go to a course
- Click to add an activity or resource, selecting "External tool" when prompted.
- In the "Tool URL" field, enter the tool's Launch URL you noted before.
- Click the "Show more" link.
- In the "Shared secret" field, enter the tool's Secret you noted before.
- For "Consumer Key", enter "MOODLE_CONSUMER".
- Check the privacy section of the form and make sure "Share launcher's name with the tool" and "Share launchers email with the tool" are both checked
- Save and display
- Verify you are launched into the assignment.
- Now, time to set up the LTI Advantage tool registration. We'll use dynamic registration for this. First, log out of both the tool and the platform.
- Go to the tool site and log in as an admin user.
- Go to Site admin > Plugins > Enrolments > Publish as LTI tool > Tool registration
- Click "Generate registration URL"
- Copy this value to the clipboard using the "copy to clipboard" control
- Now, log into the platform site as an admin
- Go to Site admin > Plugins > Activity modules > External tool > Manage tools
- Paste the dynamic registration URL from your clipboard into the URL field you see on that page
- Click "Add LTI Advantage"
- If prompted, click "Register as a new external tool" (button at the bottom)
- When the process completes and you're back on the manage tools page, edit the pending tool registration you just created
- Rename it to "Moodle LTI Advantage Tool", set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool" and save.
- When the page reloads and the tool card is seen below, click "Activate" to activate the tool registration
- Now, log out of both the tool and the platform.
- Log in to the platform as the user t1
- Now, go to the platform course and click to add an activity
- Select "Moodle LTI Advantage Tool" from the preconfigured tools
- Click "Select content"
- Verify you're asked to link your tool account.
- Open a new tab and sign in to the tool site as the teacher 't1'
- In the original tab, close the modal and click "Select content" again.
- Proceed to link your account by clicking the "Link this account" button.
- Click continue
- Verify you see a modal with the text "Published Content: No resources or activities are published yet"
- Now, go back to the tool site, and publish an activity over LTI Advantage (Published as LTI tools > Add)
- Select the file resource
- Save.
- Repeat the "Select content" action in the platform site now
- Verify you see the file resource shared over LTI Advantage.
- Select the file resource and click the "Add content" button.
- Check the privacy section of the form and make sure "Share launcher's name with the tool" and "Share launchers email with the tool" are both checked
- Save the external tool edit form and return to course.
- Click to view the external file resource you just created
- Verify you can launch into the file
- Try launching the LTI 1.1 assignment again
- Verify that still works too
- Now log out of the platform
- Log in to the platform as the student 's1'
- Launch the 1.1 assignment and again verify you're taken into the assignment
- Launch the 1.3 file resource and again verify you're taken into the file
- Log out of the tool and platform sites.
- Log in to the tool site as t1
- Go to the course and view participants
- Verify you see two different rows for user s1, each having its own enrolment method. This effectively confirms that the user launching the assignment over 1.1 is being identified as a different user to the user launching the file resource over 1.3.
Consumer key based migration (covered by phpunit so no testing required)
This test confirms that staff are able to migrate a tool deployment from 1.1 to 1.3, under certain circumstances, allowing existing users of a resource/activity to continue to access content and see their grades. This usually requires that the instance of the tool on 1.1 is represented the same way in LTI 1.3. E.g. If the tool instance is a deployment within a course in 1.1, the tool deployment should also be a course level deployment in 1.3. Since this isn't the case in Moodle (Moodle's platform side is a single deployment model), this is tricky to test nicely with Moodle, but we'll do our best to simulate what would happen under a best-case scenario with other platforms that do support multiple deployments.
In the platform site, go to "Plugins > External tool > Manage tools" and edit the preconfigured tool entry in site admin
Select "This is an upgraded legacy tool" checkbox
Verify you see two new fields appear - consumer key and shared secret
Enter the consumer key from the 1.1 tool deployment into consumer key. MOODLE_CONSUMER
Copy the secret from the 1.1 published tool on the tool site (in the course, under Course settings -> Publish as LTI Tools -> Legacy LTI) and paste it into the shared secret field
Save.
This LTI Advantage tool is now set up to simulate a migration of a user from 1.1 -> 1.3 for that single deployment. Migration only takes place the first time tools launch for a given user, so we'll need to use a new user for this. To migrate a user we'll need to launch into a resource that has existing users in 1.1, over 1.3. Log in to the tool site as admin
Go to the course and publish the assignment again, this time over LTI 1.3
Log out
Log in to the platform site as the teacher
Click to add a new activity to the course, selecting 'Moodle LTI Advantage Tool' when prompted
Click "Select content"
Login as teacher t1
Select the assignment, with grades, and click the "Add content" button
In Privacy, make sure "Share names with the tool" and "Share email with the tool" are both checked
Save the edit form and return to course
Log out
Log in to the platform as student s2.
Launch the 1.1 assignment activity.
Verify you're taken into the assignment (this sets up the legacy data for the assignment for user s2)
Now, launch the 1.3 assignment activity
Verify you're taken into the assignment
Now, log in to the tool site as the teacher or admin
Go to the course
Go to the participants
Verify:
You see user s2 listed only once
You see two enrolment methods against user s2 - one for the LTI 1.1 enrolment method and one for the LTI 1.3 enrolment method.
Show
Prerequisites
You need two moodle sites (localhost is fine) - one called 'platform' and one called 'tool'
For BOTH sites, go to admin and remove all entries from "curlsecurityblockedhosts", saving the setting.
The platform site should contain a course with:
A teacher t1
A few students (s1, s2)
The tool site should contain a course with:
A teacher t1
An assignment (using defaults is fine)
A file resource (anything is fine)
In the tool site admin settings:
Enable enrol_lti and auth_lti plugins
Enable "Allow frame embedding"
Coexistence
This test confirms that we're able to register a tool site over LTI Advantage and launch into resources and activities over BOTH LTI 1.1 and LTI Advantage - aka the new and old tools can coexist. This is the preferred method of setting up LTI Advantage with Moodle consumers (i.e. Moodle to Moodle), since Moodle platforms use a single deployment model, and thus don't suit the consumer key based upgrade path very well.
First we want to set up a 1.1 tool and launch it. In the tool site, go to a course
Under 'Participants' > 'Enrolment methods' select 'Publish as LTI tool' from the "Add method" list
Change the LTI version to "Legacy LTI"
Enter an instance name
Select an activity to be published (assignment is fine)
Leave everything else on defaults
Save
Access "Published as LTI tools" via the course admin and under the "Legacy LTI" tab, note the "Launch URL" and "Secret" (leave this tab open)
Now, in another browser session log in to the platform site.
Go to a course
Click to add an activity or resource, selecting "External tool" when prompted.
In the "Tool URL" field, enter the tool's Launch URL you noted before.
Click the "Show more" link.
In the "Shared secret" field, enter the tool's Secret you noted before.
For "Consumer Key", enter "MOODLE_CONSUMER".
Check the privacy section of the form and make sure "Share launcher's name with the tool" and "Share launchers email with the tool" are both checked
Save and display
Verify you are launched into the assignment.
Now, time to set up the LTI Advantage tool registration. We'll use dynamic registration for this. First, log out of both the tool and the platform.
Go to the tool site and log in as an admin user.
Go to Site admin > Plugins > Enrolments > Publish as LTI tool > Tool registration
Click "Generate registration URL"
Copy this value to the clipboard using the "copy to clipboard" control
Now, log into the platform site as an admin
Go to Site admin > Plugins > Activity modules > External tool > Manage tools
Paste the dynamic registration URL from your clipboard into the URL field you see on that page
Click "Add LTI Advantage"
If prompted, click "Register as a new external tool" (button at the bottom)
When the process completes and you're back on the manage tools page, edit the pending tool registration you just created
Rename it to "Moodle LTI Advantage Tool", set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool" and save.
When the page reloads and the tool card is seen below, click "Activate" to activate the tool registration
Now, log out of both the tool and the platform.
Log in to the platform as the user t1
Now, go to the platform course and click to add an activity
Select "Moodle LTI Advantage Tool" from the preconfigured tools
Click "Select content"
Verify you're asked to link your tool account.
Open a new tab and sign in to the tool site as the teacher 't1'
In the original tab, close the modal and click "Select content" again.
Proceed to link your account by clicking the "Link this account" button.
Click continue
Verify you see a modal with the text "Published Content: No resources or activities are published yet"
Now, go back to the tool site, and publish an activity over LTI Advantage (Published as LTI tools > Add)
Select the file resource
Save.
Repeat the "Select content" action in the platform site now
Verify you see the file resource shared over LTI Advantage.
Select the file resource and click the "Add content" button.
Check the privacy section of the form and make sure "Share launcher's name with the tool" and "Share launchers email with the tool" are both checked
Save the external tool edit form and return to course.
Click to view the external file resource you just created
Verify you can launch into the file
Try launching the LTI 1.1 assignment again
Verify that still works too
Now log out of the platform
Log in to the platform as the student 's1'
Launch the 1.1 assignment and again verify you're taken into the assignment
Launch the 1.3 file resource and again verify you're taken into the file
Log out of the tool and platform sites.
Log in to the tool site as t1
Go to the course and view participants
Verify you see two different rows for user s1, each having its own enrolment method. This effectively confirms that the user launching the assignment over 1.1 is being identified as a different user to the user launching the file resource over 1.3.
Consumer key based migration (covered by phpunit so no testing required)
This test confirms that staff are able to migrate a tool deployment from 1.1 to 1.3, under certain circumstances, allowing existing users of a resource/activity to continue to access content and see their grades. This usually requires that the instance of the tool on 1.1 is represented the same way in LTI 1.3. E.g. If the tool instance is a deployment within a course in 1.1, the tool deployment should also be a course level deployment in 1.3. Since this isn't the case in Moodle (Moodle's platform side is a single deployment model), this is tricky to test nicely with Moodle, but we'll do our best to simulate what would happen under a best-case scenario with other platforms that do support multiple deployments.
In the platform site, go to "Plugins > External tool > Manage tools" and edit the preconfigured tool entry in site admin
Select "This is an upgraded legacy tool" checkbox
Verify you see two new fields appear - consumer key and shared secret
Enter the consumer key from the 1.1 tool deployment into consumer key. MOODLE_CONSUMER
Copy the secret from the 1.1 published tool on the tool site (in the course, under Course settings -> Publish as LTI Tools -> Legacy LTI) and paste it into the shared secret field
Save.
This LTI Advantage tool is now set up to simulate a migration of a user from 1.1 -> 1.3 for that single deployment. Migration only takes place the first time tools launch for a given user, so we'll need to use a new user for this. To migrate a user we'll need to launch into a resource that has existing users in 1.1, over 1.3. Log in to the tool site as admin
Go to the course and publish the assignment again, this time over LTI 1.3
Log out
Log in to the platform site as the teacher
Click to add a new activity to the course, selecting 'Moodle LTI Advantage Tool' when prompted
Click "Select content"
Login as teacher t1
Select the assignment, with grades, and click the "Add content" button
In Privacy, make sure "Share names with the tool" and "Share email with the tool" are both checked
Save the edit form and return to course
Log out
Log in to the platform as student s2.
Launch the 1.1 assignment activity.
Verify you're taken into the assignment (this sets up the legacy data for the assignment for user s2)
Now, launch the 1.3 assignment activity
Verify you're taken into the assignment
Now, log in to the tool site as the teacher or admin
Go to the course
Go to the participants
Verify :
You see user s2 listed only once
You see two enrolment methods against user s2 - one for the LTI 1.1 enrolment method and one for the LTI 1.3 enrolment method.