-
New Feature
-
Resolution: Done
-
Minor
-
None
-
4.2
-
MOODLE_402_STABLE
-
MDL-76703-master -
-
6
-
Team Hedgehog Sprint 2.1, Team Hedgehog Sprint 2.2
When a student’s enrolment status in a Moodle course is changed we want to update the students participation in the associated Matrix room.
Moodle has 3 enrolment states for a course:
- Not enrolled: The user is not in a course. They cannot view the content of the course of interact with any course activities, or other course participants
- Enrolled: The user is in the course and can participate and communicate with others.
- Suspended. The user is enrolled in the course and appears in the courses participant list. Any actions they did in the course before being suspended remain. However the user cannot access the course.
It will need to be confirmed which action we undertake in Matrix when a student's enrolment status changes. Matrix has several room operations related to this:
- Mute: This keeps the user in the room so they can still access the room and watch the content that is posted. But they cannot post any messages themselves in the room
- Remove from room: As it says, remove the user from the room. If the room is public the user can rejoin anytime. If the room is private the user needs to be reinvited or re added
- Ban: When a user is banned they cannot rejoin the room or be added until the ban is removed
- Remove recent messages: This is more of a moderation access than an action related to adding or removing users. Admins can remove a configurable number of the user's most recent messages.
More information can be found: https://matrix.org/docs/guides/moderation#moderating-rooms
As per the below the user story, an initial implementation makes sense to add a student to the Matrix room when they have an active enrolment in a course and remove them from the room when they are suspended or unenrolled from the Moodle course.
From an implementation perspective there should be an event observer that listens for user enrollment change events that then triggers an ad hoc task to update the room membership via Matrix API. While this operation should almost always be instantaneous, we don’t want to block operations in Moodle, waiting for a server that could be on another network or unavailable.
User stories:
- As a teacher I want students invited and removed from my courses room in Matrix based on their enrolment status in my Moodle course. Where an active enrollment means they are in the room, and a suspended or not enrolled status meaning they are not in the room. So that only students with active enrolments can participate.