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

Implement initial group support in Communication providers

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_404_STABLE
    • MDL-78551-main
    • Hide

      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 four users
      2. Create a new course and set group mode to Visible groups.
      3. Go to Participants > Groups and create two groups
      4. Go to More > Communication
      5. Set the Provider to 'Matrix'
      6. Set Room name to 'Test room'
      7. Save changes.
      8. Run the queued ad-hoc tasks by running cron from the command line php admin/cli/cron.php
      9. Refresh your course page and go to your newly created Matrix room using the link/icon in the bottom right corner.
      10. Log in using the user created during the setup (moodlebot) 
      11. CONFIRM two rooms are in this space for each group
      12. Navigate back to your course participant page
      13. Add one of the created users as a teacher
      14. Add another user as a manager
      15. Add another user as a student and add to one group
      16. Add another user as a student and add to one group
      17. Run cron from the command line (see code snippet above).
      18. Go back to your Matrix room.
      19. CONFIRM that you see a bunch of new entries:
        1. CONFIRM that the teacher in Moodle is added to all the rooms and the power level has been changed from Default to Moderator (aka Custom 51)
        2. CONFIRM that the manager in Moodle has been added to all the rooms and the power level has been changed from Default to Moderator (aka Custom 51)
        3. CONFIRM that the students in Moodle are added to the appropriate group room and the power level is unchanged and the Default
      20. Go back to your course participant page
      21. Change the role of a user from teacher to student
      22. Run cron from the command line (see code snippet above)
      23. Go back to your Matrix room
      24. CONFIRM that the power level is changed to Default and the user is removed from all groups
      25. Go back to your course participant page
      26. Change a student to a manager.
      27. Run cron from the command line (see code snippet above)
      28. CONFIRM that the power level is changed to Moderator and the user is now in both rooms
      29. Enrol the admin user or any site administrator as a student or any other role in the course
      30. Run cron from the command line (see code snippet above)
      31. Go back to your Matrix room
      32. CONFIRM that the site admin in Moodle is added to all the rooms and the power level is changed to Custom 90
      33. Go to the course communication page by choose 'communication' from the 'more' menu
      34. Disable the communication by changing the provider from 'Matrix' to 'None'
      35. Run cron from the command line (see code snippet above
      36. Go back to the Matrix room
      37. CONFIRM that the users added from Moodle are removed from all the rooms
      38. Change the group mode to no group in course settings and change the provider from 'None' to 'Matrix' again
      39. Save changes.
      40. Run the queued ad-hoc tasks by running cron from the command line php admin/cli/cron.php
      41. CONFIRM the course room is created
      42. CONFIRM all the users from group rooms are removed
      43. CONFIRM all the enrolled users are added to the course room
      44. 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 has been 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 the Default
      45. Go back to your course participant page
      46. Change the role of a user from teacher to student
      47. Run cron from the command line (see code snippet above)
      48. Go back to your Matrix room
      49. CONFIRM that the power level is changed to Default
      50. Go back to your course participant page
      51. Change a student to a manager
      52. Run cron from the command line (see code snippet above)
      53. CONFIRM that the power level is changed to Moderator
      54. Enrol a Moodle site administrator as a student (or any other role) in the course
      55. Run cron from the command line (see code snippet above)
      56. Go back to your Matrix room
      57. CONFIRM that the site admin in Moodle is added to the room and the power level is changed to Custom 90
      58. Go to the course edit page
      59. Disable the communication from Matrix to None
      60. Run cron from the command line (see code snippet above
      61. Go back to the Matrix room
      62. CONFIRM that the users added from Moodle are removed

       

      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 Create four users Create a new course and set group mode to Visible groups. Go to Participants > Groups and create two groups Go to More > Communication Set the Provider to 'Matrix' Set Room name to 'Test room' Save changes. Run the queued ad-hoc tasks by running cron from the command line php admin/cli/cron.php Refresh your course page and go to your newly created Matrix room using the link/icon in the bottom right corner. Log in using the user created during the setup (moodlebot)  CONFIRM two rooms are in this space for each group Navigate back to your course participant page Add one of the created users as a teacher Add another user as a manager Add another user as a student and add to one group Add another user as a student and add to one group 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 all the rooms and the power level has been changed from Default to Moderator (aka Custom 51) CONFIRM that the manager in Moodle has been added to all the rooms and the power level has been changed from Default to Moderator (aka Custom 51) CONFIRM that the students in Moodle are added to the appropriate group room and the power level is unchanged and the 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 and the user is removed from all groups 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 and the user is now in both rooms 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 all the rooms and the power level is changed to Custom 90 Go to the course communication page by choose 'communication' from the 'more' menu Disable the communication by changing the provider from 'Matrix' to 'None' Run cron from the command line (see code snippet above Go back to the Matrix room CONFIRM that the users added from Moodle are removed from all the rooms Change the group mode to no group in course settings and change the provider from 'None' to 'Matrix' again Save changes. Run the queued ad-hoc tasks by running cron from the command line php admin/cli/cron.php CONFIRM the course room is created CONFIRM all the users from group rooms are removed CONFIRM all the enrolled users are added to the course 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 has been 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 the 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 a Moodle 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 the 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 users added from Moodle are removed  
    • 20
    • Team Hedgehog 2023 Review 2, Team Hedgehog 2023 Sprint 3.1, Team Hedgehog 2023 Sprint 3.2, Team Hedgehog 2023 Sprint 4.1, Team Hedgehog 2023 Sprint 4.2, Team Hedgehog 2023 Sprint 4.3, Team Hedgehog 2024 Sprint 1.1, Team Hedgehog 2024 Sprint 1.2, Team Hedgehog 2024 Sprint 1.3

      Groups are an important element in how students and teachers need to communicate effectively within their courses. With this in mind, rooms within communication providers should be broken down by group, where a group mode is enabled in a course.

      This is an intentionally limited initial implementation. There are quite a few different workflows for groups and matrix, especially around visible groups vs separate groups and the permutations within, including; groupings and teacher preferences. For an initial implementation, we chose one. Others will be implemented after this initial set of functionality (informed by user feedback).

      Requirements

      1. Where a groups mode is enabled on a course, instead of creating one room for all participants in a course, we should create one room per group.
      2. The room names will be the groups names, and are not customizable (no settings are required).
      3. The name/topic of the space will use the existing course-level communication settings (room name and topic). For now, we do not need to modify the strings associated with those settings, their usage will be obvious when visiting Matrix.
      4. This change will mean if a groups mode is enabled, obviously the Matrix URL in a course will not be the same for all users. We need to do some investigation on what is the best place to link to if a user is in multiple groups within the course . We have decided we will use the latest id of the communication instance to generate the access url if multiple groups are available in a course.
      5. If a user's group membership changes, their room membership will also need to be updated. Keep in mind that enrolment status is already handled.
      6. If the course's group mode changes, room memberships/creation should occur accordingly. For example, if messaging is enabled with no groups mode in the course, the course room is created and all participants are added to the one room. If separate groups mode is then enabled on that course, all users are removed from the course room, the group rooms are created, and users are added to their respective group rooms. The reverse would then happen if group mode was disabled so that participants are moved into the course room.
      7. Both group modes (separate and visible) will be treated the same within this functionality.

      User stories

      This issue satisfies the following user stories:

      Student

      1. As a student, I want to be able to join the Matrix chat for my groups in a course from the main course page in Moodle. So I can communicate with my peers in my course and ask my teacher questions.

      Teacher

      1. As a teacher, I want to be able to join the Matrix chat for my groups in a course from the main course page in Moodle. So I can communicate with students in my groups.
      2. As a teacher when the group mode for my course is “separate groups” and the group mode for the course is “forced”, I want multiple rooms in Matrix created for my course, one for each group that has been created in Moodle and I want to be added to each Matrix room. So that my students only communicate with those with whom they share a group.

      Out of scope

      1. Any implementation related to Matrix space.
      2. Any lang string changes.
      3. Any implementation relating to groupings.
      4. Image for the group (As discussed with Mich)
      5. Separate topic name for each group (It will continue to use course topic name)
      6. Separate user journeys for separate and visible groups
      7. Showing the url of the groups added as a part of the course

            safat.shahin@moodle.com Safat Shahin
            michaelh Michael Hawkins
            David Woloszyn David Woloszyn
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 weeks, 4 days, 2 hours, 22 minutes
                3w 4d 2h 22m

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