Show
Setup
Create 2 local Moodle sites called 'platform' and 'tool'
Clear the blocked hosts for both sites, via site admin > http security > blocked hosts (just remove all hosts and save)
If you're using a non-standard HTTP port (not 80), then also add that to the whitelisted ports section as it won't be there by default.
On the tool site, navigate to Site admin -> HTTP Security
Enable Frame embedding
Testing
Using the dynamic registration process defined in the docs ( https://docs.moodle.org/400/en/Publish_as_LTI_tool#Register_Moodle_with_the_platform ), enable the relevant plugins on the tool site and create a registration for the platform site
On the tool site ensure that the LTI Authentication plugin is also enabled
Continue on the platform site (admin > manage tools) to complete the registration (again, see docs)
Now, still on the platform site, edit the preconfigured tool setting:
Tool configuration usage: "Show in activity chooser and as a preconfigured tool"
Save the tool
Click activate on the tool
Now, go to the tool site.
Create a course with one assignment
Click "More -> Published as LTI tools"
Make sure you're on the LTI Advantage tab and click "Add"
Select the assignment under "Tool to be published"
Click "Add method"
Now, go back to the platform and sign in as admin
Now, create a course with 5 students (s1..s5)
Click to add an activity, selecting "Moodle" from the activity chooser
Click "Select content"
If you're not logged in to the tool site (and don't have an account binding), you'll be prompted. Just follow the prompts and relaunch the "Select content" as required
Click the "Add to course" checkbox for the assignment you published before (add to gradebook will be automatically ticked)
Click "Add content"
When you're back on the activity edit page, save and return to the course
Click the newly created activity
Verify you can see the remote resource (the assignment) loaded in a frame (If not, did you enable frame embedding on the tool site?)
Now, log out
Log in to the platform as user s1 (one of the students)
Go to the course and launch the tool
Add a file submission and submit
Log out
Now, log in to the platform as the admin again
Launch the tool from the course and click "Grade" for the assignment
Add a grade for the user s1 and save
Now, via the command line, in the root of the tool site, run:
php admin/cli/scheduled_task.php --execute= "\enrol_lti\local\ltiadvantage\task\sync_grades"
Verify the task completes without errors
Again, via the command line, run:
php admin/cli/adhoc_task.php --execute
Verify the task completes without errors
Now, in the platform (where you're logged in as an admin) go to the course (the platform course - make sure you're not navigating using the navigation inside the tool frame!)
Go to grades
Verify you see the grade you gave the student s1
Now, log out of the platform
Log in to the tool site as the admin user
Go to the course in which you published the assignment
Go to participants
Verify you see only the admin and s1 users there
Now, via the command line, in the root of the tool site, run:
php admin/cli/scheduled_task.php --execute= "\enrol_lti\local\ltiadvantage\task\sync_members"
Verify the task completes without errors
In the tool, refresh the participants page
Verify you see the other members of the platform course now present in the list (s2 through s5)