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

Allow teachers, managers and admins to moderate their courses' Matrix rooms

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-78129-master
    • Hide

      Removing docs_required label as this is documented as part of the new Communication documentation here:

      and is also highlighted in a a 4.3 release video.
      Feel free to make any improvements or corrections directly - thanks all

      Show
      Removing docs_required label as this is documented as part of the new Communication documentation here: https://docs.moodle.org/403/en/Capabilities/communication/matrix:moderator https://docs.moodle.org/403/en/Capabilities/moodle/course:configurecoursecommunication https://docs.moodle.org/403/en/Communication https://docs.moodle.org/403/en/New_features and is also highlighted in a a 4.3 release video. Feel free to make any improvements or corrections directly - thanks all
    • Hide

      Setup

      1. Clone Andrew's helper repository:

        git clone https://github.com/andrewnicols/moodle-synapse
        cd moodle-synapse
        chmod 777 *_data
        

      2. Run the docker-compose up command:

        docker compose up -d
        

      3. Wait for about 10 seconds for the first run to complete
      4. Run the setup script:

        ./setup.sh
        

      5. Copy the command it outputs
      6. Change into your Moodle directory
      7. Paste in the command, for EXAMPLE:

        cd path/to/moodle
        sed -i '/^require_once.*lib.*setup.php.*$/i require_once("/Users/nicols/git/moodlehq/synapse/moodle-config.php");' config.php
        cd -
        

      8. If you have not done so already, edit your /etc/hosts file to add:

        127.0.0.1 element.container.docker.internal element
        127.0.0.1 synapse.container.docker.internal synapse
        127.0.0.1 keycloak.container.docker.internal keycloak
        

      9. Follow the instructions at https://github.com/andrewnicols/moodle-synapse#trusting to trust the root CA that is used for this.

      Test scenario 1

      1. Create three users
      2. Navigate to the create a new course form
      3. Add all the required information to the form
      4. Scroll down to the Communication section
      5. Set the Communication service to 'Matrix'
      6. Set Room name to 'Test room'
      7. Save changes.
      8. Run the queued adhoc tasks by running cron from the command line php admin/cli/cron.php
      9. Go to your newly created Matrix room using the link/icon in the bottom right corner.
      10. Log in using the user created during setup
      11. CONFIRM the room is created
      12. Navigate back to your course participant page
      13. Add one of the created users as teacher
      14. Add another user as manager
      15. Add another user as student
      16. Run cron from the command line (see code snippet above).
      17. Go back to your Matrix room.
      18. CONFIRM that you see a bunch of new entries:
        1. CONFIRM that the teacher in Moodle is added to the room and the power level has been changed from Default to Moderator
        2. CONFIRM that the manager in Moodle is added to the room and the power level has been changed from Default to Moderator
        3. CONFIRM that the student in Moodle is added to the room and the power level is unchanged and Default
      19. Go back to your course participant page
      20. Change the role of a user from teacher to student
      21. Run cron from the command line (see code snippet above)
      22. Go back to your Matrix room
      23. CONFIRM that the power level is changed to Default
      24. Go back to your course participant page
      25. Change a student to a manager.
      26. Run cron from the command line (see code snippet above)
      27. CONFIRM that the power level is changed to Moderator
      28. Enrol the admin user or any site administrator as a student or any other role in the course
      29. Run cron from the command line (see code snippet above)
      30. Go back to your Matrix room
      31. CONFIRM that the site admin in Moodle is added to the room and the power level is changed to Custom 90
      32. Go to course edit page
      33. Disable the communication from Matrix to None
      34. Run cron from the command line (see code snippet above
      35. Go back to the Matrix room
      36. CONFIRM that the power level for all the users  added from Moodle are changed to Default
      37. CONFIRM that the users added from Moodle are removed

      Test scenario 2

      1. Change the course default for communication to None. (Site administration > Course > Course default settings)
      2. Create three users
      3. Create a course and enroll the created users as student, manager, teachers etc
      4. Go to the course edit page
      5. Scroll down to the Communication section
      6. Set the Communication service to 'Matrix'
      7. Set Room name to 'Test room'
      8. Save changes.
      9. Run the queued adhoc tasks by running cron from the command line php admin/cli/cron.php
      10. Go to your newly created Matrix room using the link/icon in the bottom right corner.
      11. Log in using the user created during setup
      12. Go back to your Matrix room
      13. CONFIRM the room is created
      14. CONFIRM that the teacher has the power level of Moderator
      15. CONFIRM that the manager has the power level of Moderator
      16. CONFIRM that the student has the power level of Default
      17. CONFIRM that any other roles have the power level of Default

       

       

      Show
      Setup Clone Andrew's helper repository: git clone https://github.com/andrewnicols/moodle-synapse cd moodle-synapse chmod 777 *_data Run the docker-compose up command: docker compose up -d Wait for about 10 seconds for the first run to complete Run the setup script: ./setup.sh Copy the command it outputs Change into your Moodle directory Paste in the command, for EXAMPLE : cd path/to/moodle sed -i '/^require_once.*lib.*setup.php.*$/i require_once("/Users/nicols/git/moodlehq/synapse/moodle-config.php");' config.php cd - If you have not done so already, edit your /etc/hosts file to add: 127.0.0.1 element.container.docker.internal element 127.0.0.1 synapse.container.docker.internal synapse 127.0.0.1 keycloak.container.docker.internal keycloak Follow the instructions at https://github.com/andrewnicols/moodle-synapse#trusting to trust the root CA that is used for this. Test scenario 1 Create three users Navigate to the create a new course form Add all the required information to the form Scroll down to the Communication section Set the Communication service to 'Matrix' Set Room name to 'Test room' Save changes. Run the queued adhoc tasks by running cron from the command line php admin/cli/cron.php Go to your newly created Matrix room using the link/icon in the bottom right corner. Log in using the user created during setup CONFIRM the room is created Navigate back to your course participant page Add one of the created users as teacher Add another user as manager Add another user as student Run cron from the command line (see code snippet above). Go back to your Matrix room. CONFIRM that you see a bunch of new entries: CONFIRM that the teacher in Moodle is added to the room and the power level has been changed from Default to Moderator CONFIRM that the manager in Moodle is added to the room and the power level has been changed from Default to Moderator CONFIRM that the student in Moodle is added to the room and the power level is unchanged and Default Go back to your course participant page Change the role of a user from teacher to student Run cron from the command line (see code snippet above) Go back to your Matrix room CONFIRM that the power level is changed to Default Go back to your course participant page Change a student to a manager. Run cron from the command line (see code snippet above) CONFIRM that the power level is changed to Moderator Enrol the admin user or any site administrator as a student or any other role in the course Run cron from the command line (see code snippet above) Go back to your Matrix room CONFIRM that the site admin in Moodle is added to the room and the power level is changed to Custom 90 Go to course edit page Disable the communication from Matrix to None Run cron from the command line (see code snippet above Go back to the Matrix room CONFIRM that the power level for all the users  added from Moodle are changed to Default CONFIRM that the users added from Moodle are removed Test scenario 2 Change the course default for communication to None. (Site administration > Course > Course default settings) Create three users Create a course and enroll the created users as student, manager, teachers etc Go to the course edit page Scroll down to the Communication section Set the Communication service to 'Matrix' Set Room name to 'Test room' Save changes. Run the queued adhoc tasks by running cron from the command line php admin/cli/cron.php Go to your newly created Matrix room using the link/icon in the bottom right corner. Log in using the user created during setup Go back to your Matrix room CONFIRM the room is created CONFIRM that the teacher has the power level of Moderator CONFIRM that the manager has the power level of Moderator CONFIRM that the student has the power level of Default CONFIRM that any other roles have the power level of Default    
    • 10
    • Team Hedgehog 2023 Sprint 2.2, Team Hedgehog 2023 Sprint 2.3, Team Hedgehog 2023 Review 2, Team Hedgehog 2023 Sprint 3.1, Team Hedgehog 2023 Sprint 3.2, Team Hedgehog 2023 Sprint 3.3

      We need a way to allow teachers to have elevated room permissions somehow. And similar cases.

      Every user in a room has a power level - a number generally between 0 and 100. The higher the number the more power the user has that room.

      By default, the creator of the room gets the highest power level of 100 (typically called ‘Admin’), and newly joined users get a power level of 0. You can change the power level of less powerful users than yourself - for instance, an Admin (with power 100) could promote a normal user to a power level of 50 (typically called ‘Moderator’).

      We want students and teachers to have different power levels in a room. We also want to explicitly set the power levels when creating the room. We want to be explicit because then rooms created by Moodle LMS will be predictable and behave as teachers and admins expect.  If we don't set them explicitly a Matrix server may have some different defaults (like all users can kick), this could lead to unexpected behaviors.

      • We should go with the defaults for user actions as outlined in the documentation (https://spec.matrix.org/v1.7/client-server-api/#mroompower_levels) but set them explicitly.
      • Teachers and managers should get a power level 50
      • Students should get a power level of 0
      • Moodle site admins (if added to the room because the have a role in the course) should get a power level of 100
      • Power levels should updated based on Moodle LMS course role
      • We should make a new capability that can be assigned to teacher and manager roles by default.  The presence of this capability should be the thing that determines if they get a power level of 50 or not

      Docs: https://spec.matrix.org/v1.7/client-server-api/#mroompower_levels

      Out of scope

      • At this stage power levels should not be configurable via the UI. We can add this in the future if users request it.  But for now it feels like over-engineering and adding unneeded admin settings.
      • At this stage we will only be supporting the default power levels mentioned above, we will not be implementing any admin settings to make them configurable.

       

       

        1. (1) 37 Passed -- (Master)MDL-78129.png
          (1) 37 Passed -- (Master)MDL-78129.png
          89 kB
        2. (2) 17 Passed -- (Master)MDL-78129.png
          (2) 17 Passed -- (Master)MDL-78129.png
          157 kB
        3. Matrix Perms UI.png
          Matrix Perms UI.png
          234 kB
        4. scenario-1.png
          scenario-1.png
          160 kB
        5. scenario-2.png
          scenario-2.png
          108 kB

            safat.shahin@moodle.com Safat Shahin
            dobedobedoh Andrew Lyons
            David Woloszyn David Woloszyn
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 4 days, 5 hours, 57 minutes
                1w 4d 5h 57m

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