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

Support memberships using the new library

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Prerequisites

      You will need two moodle sites. One must be a Moodle 3.2 site (SITE A, integration master). The other can be 3.1 or above (SITE B)

      Setup
      Site A
      1. Go to Site administration ► Plugins ► Authentication ► Manage authentication and enable LTI authentication.
      2. Go to Site administration ► Plugins ► Enrolments ► Manage enrol plugins and enable Publish as LTI tool.
      3. Go to Site administration ► Security ► HTTP security and tick Allow frame embedding. Save the changes.
      4. Create a course and a Page resource.
      5. Under Course administration, click "Published as LTI tools".
      6. Click Add.
      7. Under Tool to be published select the Page resource that you created.
      8. Click Add method.
      9. Back on the Published tools page, copy the LTI 2 Tool URL of the page resource that you published.
      Site B
      1. On SITE B, go to Site administration ▶︎ Plugins ▶︎ Activity modules ▶︎ External tool ▶︎ Manage tools
      2. Paste the LTI 2 Tool URL that you copied earlier into the Tool URL... field.
      3. Click Add.
      4. After you're prompted with "Successful registration", click the "Continue" link.
      5. When prompted to "Are you sure you would like to activate this tool?", click "Yes"
      6. Create or navigate to a course and turn editing on.
      7. Click "Add an activity or resource" and select "External tool"
      8. Enter an activity name for the tool (e.g. "External page")
      9. Under the "Preconfigured tool" field, select the tool that you created.
      10. Click "Save and return to course}".
      Test
      1. Open another browser, or open an incognito/private browsing window on your current browser.
      2. Login as a student in SITE B.
      3. Click on the external tool.
      4. Open a terminal and go to the moodle root directory of SITE A.
      5. Run enrol LTI sync memberships

        php admin/tool/task/cli/schedule_task.php --execute=\\enrol_lti\\task\\sync_members
        

        • Go to enrolled users on SITE A and check that you can see all the members from SITE B
      6. Go to SITE B, unenrol one or more users.
      7. Run again the enrol LTI sync memberships

        php admin/tool/task/cli/schedule_task.php --execute=\\enrol_lti\\task\\sync_members
        

      8. Check the enrolled users on SITE A.
        • Confirm that the unenrolled users from SITE B has also been unenrolled in SITE A.
      9. Go to SITE B.
      10. Login as another student who is enrolled in the course in SITE B and was synced earlier.
      11. Go to the external tool.
        • Confirm that the student can access the external tool from SITE B.
      Test with the IMS LTI Tool Consumer emulator
      1. Expose SITE A on the internet using ngrok (Download ngrok and on a terminal enter "ngrok http 80 --region=au")
      2. Go to the Published as LTI tools page of the course in SITE A.
      3. Copy the Cartridge/LTI 1 Tool URL.
      4. Paste it on another browser tab. Take note of/copy the "blti:launch_url" tag from the resulting XML document. We will use this later.
      5. Open an incognito/private browsing window and go to http://lti.tools/test/tc.php to go to the Tool Consumer emulator.
      6. On the Tool Consumer emulator, paste the launch URL into the "Launch URL:" text field under the Registration settings section.
      7. In the Published tools page on SITE A's browser window, copy the tool's secret.
      8. Go back to the emulator's browser window and paste the tool's secret into the Shared secret: field.
      9. Click "Save data".
      10. After doing so, the "Launch TP" button should become enabled. Click on it.
      11. Confirm that the published tool comes up.
      12. Go back to SITE A's browser window and navigate to the course participants page.
        • Confirm that the user "John Baird" is now enrolled.
      13. Go back to the emulator's browser window and click on the "Display data" button.
      14. Under the "User data section, change the Given name of the user to "Johnny" and change the Family name to "Bird".
      15. Click "Save data"
      16. Run again the enrol LTI sync memberships

        php admin/tool/task/cli/schedule_task.php --execute=\\enrol_lti\\task\\sync_members
        

      17. Go back to SITE A's browser window and navigate to the course participants page.
        • Confirm that the user "John Baird"'s information has been updated to "Johnny Bird"
      Show
      Prerequisites You will need two moodle sites. One must be a Moodle 3.2 site (SITE A, integration master). The other can be 3.1 or above (SITE B) Setup Site A Go to Site administration ► Plugins ► Authentication ► Manage authentication and enable LTI authentication. Go to Site administration ► Plugins ► Enrolments ► Manage enrol plugins and enable Publish as LTI tool . Go to Site administration ► Security ► HTTP security and tick Allow frame embedding . Save the changes. Create a course and a Page resource. Under Course administration, click " Published as LTI tools ". Click Add . Under Tool to be published select the Page resource that you created. Click Add method . Back on the Published tools page, copy the LTI 2 Tool URL of the page resource that you published. Site B On SITE B, go to Site administration ▶︎ Plugins ▶︎ Activity modules ▶︎ External tool ▶︎ Manage tools Paste the LTI 2 Tool URL that you copied earlier into the Tool URL... field. Click Add . After you're prompted with " Successful registration ", click the " Continue " link. When prompted to " Are you sure you would like to activate this tool? ", click " Yes " Create or navigate to a course and turn editing on. Click " Add an activity or resource " and select " External tool " Enter an activity name for the tool (e.g. "External page") Under the " Preconfigured tool " field, select the tool that you created. Click " Save and return to course }". Test Open another browser, or open an incognito/private browsing window on your current browser. Login as a student in SITE B. Click on the external tool. Open a terminal and go to the moodle root directory of SITE A. Run enrol LTI sync memberships php admin/tool/task/cli/schedule_task.php --execute=\\enrol_lti\\task\\sync_members Go to enrolled users on SITE A and check that you can see all the members from SITE B Go to SITE B, unenrol one or more users. Run again the enrol LTI sync memberships php admin/tool/task/cli/schedule_task.php --execute=\\enrol_lti\\task\\sync_members Check the enrolled users on SITE A. Confirm that the unenrolled users from SITE B has also been unenrolled in SITE A. Go to SITE B. Login as another student who is enrolled in the course in SITE B and was synced earlier. Go to the external tool. Confirm that the student can access the external tool from SITE B. Test with the IMS LTI Tool Consumer emulator Expose SITE A on the internet using ngrok (Download ngrok and on a terminal enter " ngrok http 80 --region=au ") Go to the Published as LTI tools page of the course in SITE A. Copy the Cartridge/LTI 1 Tool URL. Paste it on another browser tab. Take note of/copy the " blti:launch_url " tag from the resulting XML document. We will use this later. Open an incognito/private browsing window and go to http://lti.tools/test/tc.php to go to the Tool Consumer emulator. On the Tool Consumer emulator, paste the launch URL into the " Launch URL: " text field under the Registration settings section. In the Published tools page on SITE A's browser window, copy the tool's secret. Go back to the emulator's browser window and paste the tool's secret into the Shared secret: field. Click " Save data ". After doing so, the " Launch TP " button should become enabled. Click on it. Confirm that the published tool comes up. Go back to SITE A's browser window and navigate to the course participants page. Confirm that the user "John Baird" is now enrolled. Go back to the emulator's browser window and click on the " Display data " button. Under the " User data section, change the Given name of the user to " Johnny " and change the Family name to " Bird ". Click " Save data " Run again the enrol LTI sync memberships php admin/tool/task/cli/schedule_task.php --execute=\\enrol_lti\\task\\sync_members Go back to SITE A's browser window and navigate to the course participants page. Confirm that the user "John Baird"'s information has been updated to "Johnny Bird"
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Epic Link:
    • Pull Master Branch:
      MDL-55825-master

      Description

      We were never able to verify whether the LTI provider's memberships synchronisation even worked. Our best bet is to go straight ahead with the new library

      1. Add code to cron implementing the membership extension service. https://github.com/IMSGlobal/LTI-Tool-Provider-Library-PHP/wiki/Membership
      2. Verify it works in the same way as the old system (by checking code) so that if anyone was using it, their code won't break.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16