Show
Prerequisites
Create two Moodle sites running on localhost - one designated 'platform', one 'tool'.
In both sites, go to admin settings and clear all values from the 'curlsecurityblockedhosts' admin setting and save.
In the platform site, create a course called "Platform course 1", with:
5 Students: s1, s2, s3, s4, s5
2 Teachers: t1 and t2
In the tool site, create a course called "Tool course 1", with:
An assignment called "Assign 1" with a max grade of 80.
An assignment called "Assign 2" with default settings
A file resource (representing a non-graded activity)
A single teacher, t1, enrolled.
In the tool site, create a course called "Tool course 2", with:
A single teacher t2 enrolled
In the tool site admin settings:
Enable enrol_lti and auth_lti plugins
Enable "Allow frame embedding"
Registration
On the tool site, go to Admin > Plugins > Enrolments > Publish as LTI tool > Tool registration
Verify you see two sections: "Registration endpoints" and "Registered platforms"
Click the "Manual registration" tab under the "Registration endpoints" sectio
Keep this page open, we'll need it shortly.
On the platform site, go to 'Admin > Plugins > Activity modules > External tool > Manage tools'
Click 'Configure a tool manually'
Enter the following values:
In "Name" enter "Moodle LTI Advantage Tool"
In 'Tool URL', paste the value copied from "Tool URL" in the tool.
Set 'LTI Version' to 1.3
Set 'Public key type' to 'Keyset URL'
In 'Public keyset' paste the value copied from"JWKS URL" in the tool
In 'Initiate login URL', paste the value copied from "Initiate login URL" in the tool
In 'Redirection URI(s)' paste the value copied from BOTH "Tool URL" and "Deep linking URL" rows in the tool. Make sure each is on its own line.
Set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
Check 'Supports deep linking'
In 'Content selection URL', paste the value copied from "Deep linking URL" in the tool
Under "Services" set "IMS LTI Assignment and Grade Services" to "Use this service for grade sync and column management"
Under "Services" set "IMS LTI Names and Role Provisioning" to "Use this service to retrieve members' information as per privacy settings"
Set tools settings to "Do not use this service"
Save the tool (you'll be taken to the manage tools page again)
For the tool you just created, click "View configuration details"
Copy these configuration details somewhere, or be ready to access them again.
Now, switch back to the tool site
Under "Registered platforms" click "Register a platform"
Enter the following values:
Set "Platform name" to 'Moodle platform'
In "Platform Id (Issuer)" paste the value you copied from the "Platform ID" field in the configuration details
In "Client ID" paste the value you copied from the "Client ID" field in the configuration details
In "Authentication request URL" paste the value you copied from "Authentication request URL" in the configuration details
In "Public keyset URL" paste the value you copied from "Public keyset URL" in the configuration details
In "Access token URL" paste the value you copied from "Access token URL" in the configuration details
Save changes
Verify :
You now see an entry in the Tool site's "Registered Platforms" table.
There are no deployments listed under the "Deployments" column of this table.
You can see 3 actions: "Edit", "Manage deployments" and "Delete"
Click "Manage deployments"
Click "Add a deployment"
Set the following values:
In "Name" enter "Site wide deployment"
In "Deployment Id" paste the value you copied from "Deployment Id" in the the configuration details
Save the deployment
Verify :
You see one entry in the "Manage deployments" table
The only action available is "Delete".
This concludes the registration portion of the testing.
Simple deep link launch
Log out of both the platform and tool sites completely
In the platform site, login at the user t1
Go to the "Platform course 1" course
Click to add a new activity, selecting "Moodle LTI Advantage Tool"
When the edit page loads, click the "Select content" button
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.
Verify you see "No resources or activities are published yet" in the resulting modal pane. We'll need to publish some resources first.
Go to the tool site's course 'Tool course 1'.
From the menu, select "Published as LTI Tools"
Verify :
You see a page with 2 tabs: "LTI Advantage" and "Legacy LTI (1.1/2.0" and that "LTI Advantage" is selected by default
There is a blue info notification saying "No resources or activities are published yet"
Click the "Legacy LTI" tab
Verify :
You see a yellow warning notification saying the 1.1/.2.0 tools are now deprecated.
You see a blue info notice stating "No tools provided"
Go back to the "LTI Advantage" tab
Click "Add"
Verify "LTI Version" is set to "LTI Advantage" by default
Enter the following values:
Set "Tool to be published" to "Assign 1"
Save
Verify :
You're taken back to the "LTI Advantage" tab
You now see an entry in the table
You can see 'Launch URL' and 'Custom properties' in the "Launch details" column
Custom properties is set to something like 'id=some-uuid-value-here'
Clicking each field's input in the "Launch details" column selects that whole value, ready for copying to clipboard.
Now, go back to the platform site
Again, click "Select content"
Verify :
You are not asked to log in this time (you should still be signed in from the last time)
You can see the assignment listed under its parent course.
You can see both "Add to course" and "Add to gradebook" check boxes next to "Assign 1"
You DO NOT see any checkboxes for the course row itself
Check the "Add to course" checkbox
Verify the "Add to gradebook" checkbox is automatically checked
Uncheck the "Add to course" checkbox
Verify the "Add to gradebook" checkbox is automatically unchecked
Check the "Add to Gradebook" checkbox
Verify the "Add to course" checkbox is automatically checked
Uncheck the "Add to gradebook" checkbox
Verify the "Add to course" checkbox IS NOT unchecked this time.
Make sure no check boxes are selected and submit the form
Verify that the modal closes and no errors are seen
Click "Select content" again
Make sure both checkboxes for "Assign 1" are checked this time
Submit the form
Verify you see (you may need to click "Show more" to see this option):
That the mod edit form has been updated, with name set to "Assign 1" now
That 'Custom parameters' contains a value like 'id=some-uuid-value-here'
That the grade has been set to "Point" with "Maxgrade" set to 80, as per the resource's settings in the tool
That under "Privacy", "Accept grades from the tool" is checked.
Under privacy, check "Share names with the tool" and "Share emails with the tool"
Make sure "Launch container" is set to "Embed"
Click "Save and return to course"
Simple resource link launch
Open up a new incognito session and sign in to the tool site as an admin user
Go to the course participants view in this session.
Now go back to your platform site session and log in as the teacher t1 (if not already)
Click the activity "Assign 1" which you just created in the deep linking launch section of the testing above.
Verify :
You can see the assignment in the tool site, as an embedded iframe in your platform site.
You can see a navigation bar for the tool site in the iframe (i.e. Embedding is not forced yet)
In the incognito tab, reload the participants page
Verify you see a single user 't1' present in that course. I.e. the teacher's existing account has been found and used.
In the normal platform session, log out of the t1 account
Log in as the student s1
Launch the resource "Assign 1"
Verify:
You can see the assignment in the tool site, as an embedded iframe in your platform site.
You DO NOT see the nav drawer or nav as part of this view.
In the incognito tab, reload the participants page
Verify you see a new user there, complete with email, firstname and surname. Check these details match those of s1 in the platform site.
As the student, complete the assignment (submit a file)
Log out of the platform site.
Log in as the teacher
Launch the "Assign 1" resource again from the platform course
Verify that you now see "Participants: 1" in the assign summary, since the student launched into the resource.
Click "View all submissions" and confirm that you see a list containing the student
Force embedded layout custom property
Continuing on from the "Simple resource link launch" steps from above...
As the teacher in the platform course, edit the activity "Assign 1"
Click "Show more" and under "Custom parameters" as "force_embed=true" on a new line of its own
Save
Launch the resource
Verify that you no longer see the navigation drawer or page headers in the embedded tool site. I.e. force_embed is working as expected.
Edit the activity, remove that custom property and save.
Access control during content selection
Log out of the tool site.
Log in to the platform as user t2
Access the course "Platform course 1"
Click to add new activity and select "Moodle LTI Advantage Tool"
When the edit page loads, 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 't2'
In the original tab, close the modal and click "Select content" again.
Proceed to link your account by clicking the "Link this account" button.
Verify you see no published content
Log out of the user t2 in the tool site
Log into the tool site as the admin user
Enrol t2 into "Tool course 1" as teacher
Log out of the tool site
In the platform site, press "Select content" again
Verify you now see the published content from "Tool course 1"
As admin user, remove user t2 from the tool course "Tool course 1".
Manual sharing of resources (and creation of resource links)
Log out of all users in the tool site
Log in as teacher t1 in "Tool course 1"
Click "Published as LTI Tools" in the course administration
Note the Launch URL and Custom Properties of "Assign 1". Write these down and pretend you emailed these details to another platform user, t2.
Log out of the tool site.
Log in to the platform site as user t2
Go to the course "Platform course 1"
Click to add an activity, selecting "Moodle LTI Advantage Tool"
When the edit page loads, press "Select content"
Verify you see "No resources or activities are published yet" in the resulting modal pane. This just verifies that user t2 does not have access to the published resource in "Tool course 1" via content selection.
Close the modal
Click "Show more"
Enter the Launch URL from the earlier step into the "Tool URL" field
Enter the Custom properties value from the earlier step into "Custom parameters"
Save
Launch the activity and Verify
You can see the assignment in the tool site, as an embedded iframe in your platform site.
Log out of both the platform and tool sites.
Log in to the tool site as an admin user
Go to "Test course 1"
Go to "Participants"
Verify you see the user t2 listed with 'No roles'. This user has only been enrolled in the course. All roles will have been assigned at module context, so we'll confirm that next.
Go back to course home and click "Assign 1"
Go to "Locally assigned roles" in the module settings ('More' menu)
Verify you see user t2 listed with the role of teacher.
Log out of both the platform and the tool.
Missing tool deployment
As admin, in the tool site, remove the deployment '1' via 'Admin > Plugins > Enrolments > Tool Registration > Manage deployments'
As the teacher 't1' in the platform, try both content selection and resource link (activity) launches
Verify both fail with an exception "Unable to find deployment"
Add the deployment '1' back (you can name it anything)
As the teacher 't1' in the platform, try both content selection and resource link (activity) launches
Verify both now work as before
Course sharing
Sign in as the teacher 't1' in the tool
Go to the tool site's course "Tool course 1"
From the menu, select "Published as LTI Tools"
Click "Add"
Enter the following values:
Set "Tool to be published" to "Course"
Save.
Log out of the tool.
Log in to the platform site as user t1
Go to the course "Platform course 1"
Click to create a new resource/activity
Select "Moodle LTI Advantage Tool"
Click "Select content"
Verify :
You see checkboxes next to the course "Tool Course 1" for both "Add to course" and "Add to gradebook"
You still see checkboxes next to "Assign 1" too.
Make sure both checkboxes for "Tool course 1" are selected and click "Add content"
Submit the form
Verify you see (you may need to click "Show more" to see this option):
That the mod edit form has been updated, with name set to "Tool Course 1" now
That "Launch container" is set to "Embed"
That 'Custom parameters' contains a value like 'id=some-uuid-value-here'
That under "Privacy", "Accept grades from the tool" is checked.
That the grade has been set to "Point" with "Maxgrade" set to 180 - the summation of "Assign 1" (80 points) and "Assign 2" (100 points).
Under privacy, check "Share names with the tool" and "Share emails with the tool"
Click "Save and return to course"
Verify you see a validation error saying that 180 exceeds the maximum grade value for a resource in the platform (this may not be the case in all platforms but since grade values are sent as a percentage, this won't matter)
Set the grade to 100 and save the activity.
Now, launch the activity you just created.
Verify :
You see the course load in an iframe
You see the drawer and navigation
Click "Assign 2"
Verify you can view it without any warning/error.
Now go to course home
Launch the shared module activity "Assign 1"
Log out of the tool and platform
Log in to the platform as a student s1
Go to "Platform course 1"
Launch the activity "Assign 1"
Go back to course home
Launch the activity "Tool Course 1"
Verify :
You see the course load in an iframe
You don't see the drawer and navigation
Click "Assign 2"
Verify you can view it without any warning/error.
Log in to the tool site as the teacher t1
Verify :
You see the same 2 entries in the participants page for the teacher (t1) and student (s1)
That each row (t1, s1) has 2 enrolment methods listed - one for the shared course and one for the shared activity.
Now, go to "Published as LTI tools"
Delete the "Tool Course 1" enrolment method
Confirm the action
Go to the participants page again
Verify :
That there are still 2 people listsed: t1 and s1
That each row (t1, s1) for the platform users has only one enrolment method listed now - for the "Assign 1" activity.
Log out of the tool and platform.
Non-graded activities
Log in to the tool site as t1
Go to the course "Tool course 1"
Go to "Published as LTI Tools"
Add new
Select the file resource
Save
In the platform, log in as the teacher t1
Go to the platform course "Platform Course 1"
Click to add an activity/resource
Select "Moodle LTI Advantage Tool"
Click "Select content"
Verify :
You see the file resource listed under the course "Tool Course 1"
The file resource has only a single checkbox "Add to course". There is no checkbox for "Add to gradebook"
Select the file resource checkbox
Click "Add content"
Verify you see (you may need to click "Show more" to see this option):
That the mod edit form has been updated, with name set to the name of the file resource
That 'Custom parameters' contains a value like 'id=some-uuid-value-here'
That the grade options have been hidden from the form entirely
That under "Privacy", "Accept grades from the tool" is not checked.
Under privacy, check "Share names with the tool" and "Share emails with the tool"
Make sure "Launch container" is set to "Embed"
Click "Save and return to course"
Launch the resource by clicking the activity you just created
Verify you can see the file
Check the course gradebook
Verify there is no grade column for this activity.
Log out of both tool and platform.
Hiding published resources
Log in to the tool site as t1
Go to the course "Tool course 1"
Go to "Published as LTI Tools"
Next to the "Assign 1" published resource, click the eye to hide it.
In the platform, log in as the teacher t1
Go to the course "Platform Course 1"
Launch the activity that points to the "Assign 1" resource
Verify you see an error saying the resource is unavailable or does not exist.
In the tool, unhide the resource
Launch again in the platform
Verify the launch works without any error.
Log out of the platform and the tool.
Backup and restore
Log into the tool as the admin user
Go to the course "Tool course 1"
Backup the course
From course settings, select "Restore"
Proceed to restore the course into a new course - name it something like "RESTORE"
Once restored, open the RESTORE course
View the "Published as LTI tools" page
Edit the "Assign 1" published resource
Check the custom properties value of id
Verify this is different to the id of the published "Assign 1" in "Tool course 1"
Privacy settings
Log in to the platform as teacher t1
Go to course "Platform Course 1"
Edit the settings for the activity "Assign 1"
Uncheck both "Share emails with the tool" and "Share names with the tool"
Save
Launch "Assign 1"
Log out of the platform
Log in to the platform as user s1
Go the the course "Platform course 1"
Launch "Assign 1"
Log out of the tool and the platform
Log into the tool site as teacher t1
View the course participants page
Verify you see:
a user with numeric firstname/surname values and an email that resembles "enrol_lti_eadc1234..@example.com"
the user t1, with proper firstname, surname and email (this confirms the preexisting accounts are not updated with platform details on launch)
Log out of the tool site
Log in to the platform site as user t1
Go to the course "Platform course 1"
Edit the activity settings again for "Assign 1"
Check both "Share emails with the tool" and "Share names with the tool" and save.
Log out of the platform.
Log in to the platform as user s1
Go to "Platform course 1"
Launch the activity "Assign 1"
Log out
Log in to the tool site as the user t1 now
Go to "Tool course 1"
Go to "Participants"
Verify :
You don't see that pseudo-anonymous entry any more
You see an enrolment entry for the teacher t1
You see an enrolment entry for the platform user s1 and this time the firstname, surname and email are all correct (non-numerical and match those values in the platform user's profile).
Legacy tool publication
Go to the tool site and create a new course
In that course, create an assignment
Go to course admin > Published as LTI tools
Click 'Add'
Change version to "Legacy LTI (1.1/2.0).."
Set "Custom instance name" to "Legacy LTI assignment"
Select the assignment under "Tool to be published"
Click "Add method"
Go to the "Legacy LTI" tab
Verify you see the method listed.
Verify you see the following under the "Launch details" column:
Cartridge URL
Secret
Launch URL
Verify you see a "Registration URL" column and that there is data in that column (should look like enrol/lti/proxy.php)
Edit the method and Verify the LTI Version is set on "Legacy LTI" still
Change this method to "LTI advantage" and save
Go to the "LTI Advantage" tab (should already be here)
Verify you see the method listed with only "Launch URL" and "Custom properties" listed in the "Launch details" column of the table.
Verify that in custom properties you see a value for 'id'. I.e. confirm you see the string 'id=xxxxxxx-xxxx-xxxxx-xxxxxxx'