Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69544

Update grade sync task to support 1.3 messages

    XMLWordPrintable

Details

    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MDL-69544-master
    • Hide

      Prerequisites

      1. Create two Moodle sites running on localhost - one designated 'platform', one 'tool'.
      2. In both sites, go to admin settings and clear all values from the 'curlsecurityblockedhosts' admin setting and save.
      3. In the platform site, create a course called "Platform course 1", with:
        • 2 Students: s1 and s2
        • 2 Teachers: t1 and t2
      4. 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.
      5. In the tool site admin settings:
        • Enable enrol_lti and auth_lti plugins
        • Enable "Allow frame embedding

      Register the tool and platform

      Note: This is a shortened process of setting up the Moodle LTI Advantage Tool. If you've already set this up as part of another test, you can safely skip this section.

      1. On the tool site, go to Admin > Plugins > Enrolments > Publish as LTI tool > Tool registration
      2. Access to "Manual registration"  and keep this page open, we'll need it shortly.
      3. On the platform site, go to 'Admin > Plugins > Activity modules > External tool > Manage tools'
      4. Click 'Configure a tool manually'
      5. Enter the following values:
        • In "Name" enter "Moodle LTI Advantage Tool"
        • Set 'LTI Version' to 1.3
        • Set public key type to 'Keyset URL'
        • In 'Tool URL', paste the value copied from "Tool URL" in the tool.
        • 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.
        • 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"
        • Set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
      6. Save the tool (you'll be taken to the manage tools page again)
      7. For the tool you just created, click "View configuration details"
      8. Copy these configuration details somewhere, or be ready to access them again.
      9. Now, switch back to the tool site
      10. Under "Registered platforms" click "Register a platform"
      11. 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
      12. Save changes
      13. Click "Manage deployments" next to the registration you just created
      14. Click "Add a deployment"
      15. 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
      16. Save the deployment
      17. Log out of both tool and platform.

      Publish activities and set up platform resource links

      1. Log in to the tool site as t1
      2. Click "Published as LTI Tools" in course setting
      3. Click "Add new"
      4. Publish the "Assign 1" resource, using all default settings (this ensures membersync is enabled)
      5. Repeat the process and publish the "Assign 2" resource
      6. Repeat the process and publish the "Tool Course 1" resource
      7. Repeat the process and publish the file resource
      8. Now log out of the tool.
      9. In the platform, log in as teacher t1
      10. Go to "Platform course 1"
      11. Click to add an activity/resource
      12. Select "Moodle LTI Advantage Tool"
      13. Click "Select content"
      14. Verify you're asked to link your tool account.
      15. Open a new tab and sign in to the tool site as the teacher 't1'
      16. In the original tab, close the modal and click "Select content" again.
      17. Proceed to link your account by clicking the "Link this account" button.
      18. Click continue and when the pane loads the resource list, select all check boxes next to "Assign 1" (clicking just the left box will do this for you)
      19. Click "Add content"
      20. Make sure "Share emails with the tool" and "share names with the tool" is selected.
      21. Make sure the "Launch container" is set to "New window" (under General > Show more)
      22. Save
      23. Repeat the process to publish "Assign 2" the same way.
      24. Repeat the process to publish "Tool Course 1" the same way. You will need to change the maxgrade to 100 before you can save the activity.
      25. Repeat the process for the file resource, this time noting that you will not see "Add to gradebook" when viewing the resource in deep linking.
      26. Verify the four activities are created.
      27. Now, log out of the platform.

      Launch the activities and perform grading

      1. Log in to the platform as student s1
      2. Go to course "Platform course 1"
      3. Launch the lti resource "Assign 1"
      4. Submit to the assignment
      5. Launch the lti resource "Assign 2"
      6. Submit to the assignment
      7. Launch the lti resource "Tool Course 1"
      8. Launch the lti file resource
      9. Log out of both the tool and the platform.
      10. Log in to the platform as student s2
      11. Go to course "Platform course 1"
      12. Launch the lti resource "Tool Course 1"
      13. Launch the lti resource "Assign 2"
      14. Submit to the assignment
      15. Now, log in to the platform as the teacher t1
      16. Go to "Platform course 1"
      17. Launch "Assign 1"
      18. Grade the user s1, scoring them 45/80
      19. Launch "Assign 2"
      20. Grade the user s2, scoring them 60/100

      Sync and confirm results

      1. Go to the gradebook page in the platform
      2. Verify there are no grades present yet.
      3. Now, run the grade sync task (in the tool) via cli:

        php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades'
        

      4. Verify the task runs without any errors.
      5. Go back to the platform gradebook page and reload.
      6. Verify:
        • You see a grade 45/80 for user s1 in "Assign 1"
        • You see no grade for user s1 in "Assign 2"
        • You see a grade of 25/100 for the user s1 in "Tool course 1" - this is because the user has scored 45/180 in that course in the tool.
        • You see a grade of 60/100 for user s2 in "Assign 2"
        • You see no grade for user s2 in "Assign 1"
        • You see a grade of 33.33/100 for the user s1 in "Tool course 1" - this is because the user has scored 60/180 in that course in the tool.
        • You don't see any errors relating to the file resource

      Testing completion-based grade sync

      1. Login to the tool as the t1 teacher user
      2. Create a new assignment in the test course called "Completion assign"
      3. Edit the assignment and under "Activity completion", set "Show activity as complete when conditions are met"
      4. Check the "Student must submit to this activity to complete it"
      5. Go to Course admin > Published as LTI tools and click "Add"
      6. Select "Completion assign"
      7. Set a custom instance name of "Published completion assign"
      8. Under "Remote system", set "Require course or activity completion prior to grade synchronisation" set to "Yes"
      9. Save
      10. Now, login to the platform site as the teacher
      11. Click to add a new resource/activity to the course
      12. Select "Moodle LTI Advantage Tool"
      13. Click "Select content"
      14. Login as teacher t1
      15. Select all check boxes next to "Completion assignment"
      16. Click "Add content"
      17. Make sure "Share emails with the tool" and "share names with the tool" is selected.
      18. Make sure the "Launch container" is set to "New window" (under General > Show more)
      19. Save
      20. Log out
      21. Now log in to the platform as the s1 student user
      22. Go to the course and launch the "Completion assignment" resource link you just created. Don't submit anything!
      23. Now, log out of both platform and tool sites
      24. Log in to the tool site as an t1 again
      25. Go to the "Completion assignment" and select "View all submissions"
      26. Grade the user s1 who just launched (but didn't submit). Set a grade of 80 or something that you'll remember.
      27. Now, log in to the platform as the user t1 and go to the gradebook in the course. Keep this open
      28. Now, in a terminal, run the task to sync grades:

        php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades'
        

      29. In the platform, refresh the gradebook page
      30. Verify you don't see the grade 80 listed for the user
      31. Now, log out of the platform
      32. Log in to the platform as s1 student
      33. Again, launch "Completion assignment"
      34. Now, make a submission
      35. Log out of the platform
      36. Now, log in to the platform as the user t1 and go to the gradebook in the course. Keep this open
      37. Now, in a terminal, run the task to sync grades:

        php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades'
        

      38. In the platform, refresh the gradebook page
      39. Verify you now do see the grade 80 listed for the user s1
      40. Log out of both the tool and the platform sites.

      Testing the grade synchronisation setting

      1. Continuing on from the above, login to the tool site as the t1 teacher
      2. Go to the course
      3. In Course admin > Published as LTI Tools, edit the "Completion assignment" enrolment method
      4. Expand "Remote system" and set "Grade synchronisation" to "No"
      5. Go to the "Completion assignment" and select "View all submissions"
      6. Grade the user s1, making sure to change the grade to something like 90 and saving.
      7. Now, log out of the tool
      8. Now, log in to the platform as the user t1 and go to the gradebook in the course. Keep this open
      9. Now, in a terminal, run the task to sync grades:

        php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades'
        

      10. Verify you still see the grade 80 (i.e. not the current grade of 90). This means the sync didn't run.
      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: 2 Students: s1 and s2 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 admin settings: Enable enrol_lti and auth_lti plugins Enable "Allow frame embedding Register the tool and platform Note: This is a shortened process of setting up the Moodle LTI Advantage Tool. If you've already set this up as part of another test, you can safely skip this section. On the tool site, go to Admin > Plugins > Enrolments > Publish as LTI tool > Tool registration Access to "Manual registration"  and 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" Set 'LTI Version' to 1.3 Set public key type to 'Keyset URL' In 'Tool URL', paste the value copied from "Tool URL" in the tool. 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. 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" Set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool" 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 Click "Manage deployments" next to the registration you just created 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 Log out of both tool and platform. Publish activities and set up platform resource links Log in to the tool site as t1 Click "Published as LTI Tools" in course setting Click "Add new" Publish the "Assign 1" resource, using all default settings (this ensures membersync is enabled) Repeat the process and publish the "Assign 2" resource Repeat the process and publish the "Tool Course 1" resource Repeat the process and publish the file resource Now log out of the tool. In the platform, log in as teacher t1 Go to "Platform course 1" Click to add an activity/resource Select "Moodle LTI Advantage Tool" 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 and when the pane loads the resource list, select all check boxes next to "Assign 1" (clicking just the left box will do this for you) Click "Add content" Make sure "Share emails with the tool" and "share names with the tool" is selected. Make sure the "Launch container" is set to "New window" (under General > Show more) Save Repeat the process to publish "Assign 2" the same way. Repeat the process to publish "Tool Course 1" the same way. You will need to change the maxgrade to 100 before you can save the activity. Repeat the process for the file resource, this time noting that you will not see "Add to gradebook" when viewing the resource in deep linking. Verify the four activities are created. Now, log out of the platform. Launch the activities and perform grading Log in to the platform as student s1 Go to course "Platform course 1" Launch the lti resource "Assign 1" Submit to the assignment Launch the lti resource "Assign 2" Submit to the assignment Launch the lti resource "Tool Course 1" Launch the lti file resource Log out of both the tool and the platform. Log in to the platform as student s2 Go to course "Platform course 1" Launch the lti resource "Tool Course 1" Launch the lti resource "Assign 2" Submit to the assignment Now, log in to the platform as the teacher t1 Go to "Platform course 1" Launch "Assign 1" Grade the user s1, scoring them 45/80 Launch "Assign 2" Grade the user s2, scoring them 60/100 Sync and confirm results Go to the gradebook page in the platform Verify there are no grades present yet. Now, run the grade sync task (in the tool) via cli: php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades' Verify the task runs without any errors. Go back to the platform gradebook page and reload. Verify : You see a grade 45/80 for user s1 in "Assign 1" You see no grade for user s1 in "Assign 2" You see a grade of 25/100 for the user s1 in "Tool course 1" - this is because the user has scored 45/180 in that course in the tool. You see a grade of 60/100 for user s2 in "Assign 2" You see no grade for user s2 in "Assign 1" You see a grade of 33.33/100 for the user s1 in "Tool course 1" - this is because the user has scored 60/180 in that course in the tool. You don't see any errors relating to the file resource Testing completion-based grade sync Login to the tool as the t1 teacher user Create a new assignment in the test course called "Completion assign" Edit the assignment and under "Activity completion", set "Show activity as complete when conditions are met" Check the "Student must submit to this activity to complete it" Go to Course admin > Published as LTI tools and click "Add" Select "Completion assign" Set a custom instance name of "Published completion assign" Under "Remote system", set "Require course or activity completion prior to grade synchronisation" set to "Yes" Save Now, login to the platform site as the teacher Click to add a new resource/activity to the course Select "Moodle LTI Advantage Tool" Click "Select content" Login as teacher t1 Select all check boxes next to "Completion assignment" Click "Add content" Make sure "Share emails with the tool" and "share names with the tool" is selected. Make sure the "Launch container" is set to "New window" (under General > Show more) Save Log out Now log in to the platform as the s1 student user Go to the course and launch the "Completion assignment" resource link you just created. Don't submit anything! Now, log out of both platform and tool sites Log in to the tool site as an t1 again Go to the "Completion assignment" and select "View all submissions" Grade the user s1 who just launched (but didn't submit). Set a grade of 80 or something that you'll remember. Now, log in to the platform as the user t1 and go to the gradebook in the course. Keep this open Now, in a terminal, run the task to sync grades: php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades' In the platform, refresh the gradebook page Verify you don't see the grade 80 listed for the user Now, log out of the platform Log in to the platform as s1 student Again, launch "Completion assignment" Now, make a submission Log out of the platform Now, log in to the platform as the user t1 and go to the gradebook in the course. Keep this open Now, in a terminal, run the task to sync grades: php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades' In the platform, refresh the gradebook page Verify you now do see the grade 80 listed for the user s1 Log out of both the tool and the platform sites. Testing the grade synchronisation setting Continuing on from the above, login to the tool site as the t1 teacher Go to the course In Course admin > Published as LTI Tools, edit the "Completion assignment" enrolment method Expand "Remote system" and set "Grade synchronisation" to "No" Go to the "Completion assignment" and select "View all submissions" Grade the user s1, making sure to change the grade to something like 90 and saving. Now, log out of the tool Now, log in to the platform as the user t1 and go to the gradebook in the course. Keep this open Now, in a terminal, run the task to sync grades: php admin/cli/scheduled_task.php --execute='\enrol_lti\local\ltiadvantage\task\sync_grades' Verify you still see the grade 80 (i.e. not the current grade of 90). This means the sync didn't run.
    • 1
    • 4.0 holding pattern 12, 4.0 Navigation blitz, 4.0 Navigation blitz 2, 4.0 Navigation blitz 3, QA blitz

    Description

      This issue deals with updating the grade sync task in:
      enrol/lti/classes/task/sync_grades.php

      Grade sync should use assignment grade services 2:
      https://www.imsglobal.org/spec/lti-ags/v2p0

      This task should use the AGS score publish service to set the learner's score in the platform. This should also work in conjunction with MDL-70354, in that a prior declared line item should be updated if created during the resource link creation process.

      Attachments

        Issue Links

          Activity

            People

              jaked Jake Dallimore
              jaked Jake Dallimore
              Mihail Geshoski Mihail Geshoski
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 3 days, 5 hours, 26 minutes
                  1w 3d 5h 26m