Uploaded image for project: 'Moodle QA'
  1. Moodle QA
  2. MDLQA-16759 Moodle 4.1 QA
  3. MDLQA-17348

CLONE - Enrolments can be synchronised with the remote platform for activities shared using LTI

XMLWordPrintable

      Docs

      The relevant documentation for this feature can be found at Publish as LTI tool

      Note: Member sync is covered by unit tests, however, it's probably a good idea to test manually to verify the tests are making the right assertions.

      Prerequisites

      Two sites are required for testing this feature and they must be able to communicate with one another.

      1. LTI platform (formerly known as consumer)
      2. LTI tool (formerly known as provider).
        Important: If you're testing locally, you'll need to disable the 'Blocked hosts' setting in BOTH sites. You can find it in Site administration ► Security ► HTTP security. You'll need to clear the values and save.
      3. In the platform site, create a course called "Platform course 1", with:
        • 5 Students: s1, s2, s3, s4, s5
        • 2 Teachers: t1 and t2
      4. In the tool site, create a course called "Tool course 1", with:
        • An assignment called "Assign 1"
        • An assignment called "Assign 2"
        • A single teacher, t1, enrolled.

      Register the tool and platform

      1. Following the docs linked above, specifically the section on Enabling the 'Publish as LTI tool' feature, enable the relevant plugins in the tool site.
      2. Following the docs linked above, specifically the section on Dynamic registration, create the tool-platform registration
      3. In the platform site, edit the preconfigured tool settings for the tool you just created
      4. Set "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
      5. Set "IMS LTI Names and Role Provisioning" to "Use this service to retrieve members' information as per privacy settings"
      6. Change the name of the tool to "QA test tool"
      7. Save the tool configuration

      Publish activities and set up platform resource links

      1. Log in to the tool site as a teacher t1
      2. Following the docs linked above, specifically the section on Sharing access to a course or activity, publish Assign 1 over LTI Advantage. When publishing, use the form defaults.
      3. Repeat the publishing process to publish Assign 2 over LTI Advantage also.
      4. Now log out of the tool.
      5. In the platform, log in as teacher t1
      6. Go to "Platform course 1"
      7. Add a label activity "Label 1" in section 1, setting completion to "students can manually mark this activity as complete"
      8. Click to add an activity/resource
      9. Select "QA test tool"
      10. Click "Select content"
      11. When prompted, open a new tab in the same browser session and log in to the tool site as the teacher, relaunching the Select content workflow when done (i.e. just close the modal and click "Select content" again)
      12. Continue to link your account
      13. When you see the listing of published activities, select the "Add to course" checkbox for Assign 1
      14. Click "Add content"
      15. Expand the "Privacy" section of the form and make sure "Share emails with the tool" and "share names with the tool" are both checked.
      16. Save the activity
      17. Repeat the process to create a resource link to "Assign 2" the same way.
      18. Verify both activities are created.
      19. Launch each activity (first launch allows the member sync to take place).
      20. On the course home, edit the "Assign 2" activity
      21. Add an access restriction based on activity completion "The activity Label 1 is marked complete"
      22. Save.
      23. Now, log out of the platform.

      Link level memberships check

      1. Log into the platform as student s1
      2. Go to the course "Platform course 1"
      3. Verify you cannot access "Assign 2"
      4. Manually mark the label as complete.
      5. Verify you can now access "Assign 2"
      6. Launch "Assign 2"
      7. Verify you can view the assignment
      8. Now log out of the platform.
      9. Log in to the platform as user s2
      10. Go to the course "Platform course 1"
      11. Manually set the label "Label 1" as complete but DO NOT launch the "Assign 2" resource.
      12. Log out of the platform.
      13. Log in to the tool as the user t1
      14. Go to the course "Tool course 1"
      15. Go to participants
      16. Verify you see entries for users t1 and s1 from the platform, as follows:
        • t1 will have 3 enrolment methods, one for each assignment (the enrol_lti methods) and one for the course (because they were manually enrolled there to begin with)
        • s1 will have 1 enrolment method listed, for Assign 2 only.
      17. Stay on this page.
      18. Now, run the member sync task via cli (in the tool site).

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

      19. Verify the task runs without any errors.
      20. Go back to the tool participants page and reload.
      21. Verify you now see the following enrolments:
        • User s1 from the platform, with 2 enrolment methods "Assign 1" and "Assign 2"
        • User s2 from the platform, with 2 enrolment methods "Assign 1" and "Assign 2"
        • User s3 from the platform, with 1 enrolment methods "Assign 1"
        • User s4 from the platform, with 1 enrolment methods "Assign 1"
        • User s5 from the platform, with 1 enrolment methods "Assign 1"
        • User t1 from the tool (remember, this user has their account linked during the content creation portion of the test), with 3 enrolment methods "Assign 1", "Assign 2" and manual.
      22. Now, log out of the tool
      23. Log into the tool as the admin user
      24. Go to the course "Tool course 1"
      25. Open "Assign 1" and select "Locally assigned roles" from the module settings menu ("More")
      26. Verify you only see 1 entry for the teacher. Other participants won't have role assignments until they launch the resource for the first time - this is expected.
      27. Go back and open "Assign 2" and select "Locally assigned roles" from module settings now.
      28. Verify you see 2 entries: 1 for the teacher and 1 for the platform user s1. Other participants won't have role assignments until they launch the resource for the first time - this is expected.

      Mode "enrol and unenrol" (the default)

      1. Continuing on from above..
      2. Now, login to the platform as teacher t1
      3. Go to the course "Platform course 1"
      4. Enrol the user s6 as a student
      5. Unenrol user s5
      6. Now, run the member sync task via cli (in the tool site).

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

      7. Verify the task runs without any errors.
      8. Go back to the tool participants page and reload.
      9. Verify:
        • You don't see the user s5 listed any more
        • You see user s6 listed with 1 enrolment method for "Assign 1".

      Mode "enrol new"

      1. Continuing on from above..
      2. Login to the tool site as the teacher t1
      3. Go to course "Tool course 1"
      4. Click "Published as LTI Tools" in course setting
      5. Edit the published resource "Assign 1"
      6. Expand "Remote system" and set "user sync mode" to "Enrol new users"
      7. Save
      8. Now, login to the platform as teacher t1
      9. Go to the course "Platform course 1"
      10. Unenrol user s6
      11. Enrol user s7 as a student
      12. Now, run the member sync task via cli.

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

      13. Verify the task runs without any errors.
      14. Go back to the tool participants page and reload.
      15. Verify:
        • You still see the user s6 listed (i.e. they haven't been unenrolled)
        • You see user s7 listed with 1 enrolment method for "Assign 1".

      Mode "unenrol missing"

      1. Continuing on from above..
      2. Login to the tool site as the teacher t1
      3. Go to course "Tool course 1"
      4. Click "Published as LTI Tools" in course setting
      5. Edit the published resource "Assign 1"
      6. Expand "Remote system" and set "user sync mode" to "Unenrol missing"
      7. Save
      8. Now, login to the platform as teacher t1
      9. Go to the course "Platform course 1"
      10. Enrol user s8 as a student
      11. Now, run the member sync task via cli.

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

      12. Verify the task runs without any errors.
      13. Go back to the tool participants page and reload.
      14. Verify:
        • You don't see user s6 listed (i.e. they have been unenrolled)
        • You see user s7 listed with 1 enrolment method for "Assign 1" (i.e. they haven't been unenrolled)
        • You don't see user s8 listed (i.e. they haven't been enrolled)

      Membership sync disabled

      1. Continuing on from above.
      2. Login to the tool site as the teacher t1
      3. Go to course "Tool course 1"
      4. Click "Published as LTI Tools" in course setting
      5. Edit the published resource "Assign 1"
      6. Expand "Remote system" and set "User sync mode" to "Enrol new and unenrol missing users"
      7. Save
      8. Edit again and set "user synchronisation" to "No"
      9. Save again
      10. Now, run the member sync task via cli.

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

      11. Verify you don't see any task output mentioning syncing of memberships for resource 'Assign 1'.
      12. Go back to the tool participants page and reload.
      13. Verify:
        • You still don't see user s8 listed (i.e. they haven't been enrolled)

        1. MDLQA-17348_link level memberships check_1.png
          78 kB
          Angelia Dela Cruz
        2. MDLQA-17348_link level memberships check_2.png
          338 kB
          Angelia Dela Cruz
        3. MDLQA-17348_link level memberships check_3.png
          96 kB
          Angelia Dela Cruz
        4. MDLQA-17348_link level memberships check.mp4
          18.29 MB
          Angelia Dela Cruz
        5. MDLQA-17348_membership sync disabled_1.png
          439 kB
          Angelia Dela Cruz
        6. MDLQA-17348_membership sync disabled.mp4
          7.67 MB
          Angelia Dela Cruz
        7. MDLQA-17348_mode enrol and unenrol (the default)_1.png
          476 kB
          Angelia Dela Cruz
        8. MDLQA-17348_mode enrol and unenrol (the default).mp4
          10.71 MB
          Angelia Dela Cruz
        9. MDLQA-17348_mode enrol new_1.png
          522 kB
          Angelia Dela Cruz
        10. MDLQA-17348_mode enrol new.mp4
          10.27 MB
          Angelia Dela Cruz
        11. MDLQA-17348_mode unenrol missing_1.png
          488 kB
          Angelia Dela Cruz
        12. MDLQA-17348_mode unenrol missing.mp4
          8.12 MB
          Angelia Dela Cruz
        13. MDLQA-17348_publish and setup.mp4
          10.36 MB
          Angelia Dela Cruz
        14. MDLQA-17348_publish and setup.png
          177 kB
          Angelia Dela Cruz

            andelacruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.