Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Event Monitor specification: Difference between revisions

From MoodleDocs
(Adding additional use case scenarios that we brainstormed at our college.)
(removing wip note, adding 2.8 template)
(29 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Infobox Project
{{Infobox Project
|name = Event Monitor
|name = Event Monitor
|state = Specification
|state = Implemented
|tracker = MDL-45758
|tracker = MDL-45758
|discussion = https://moodle.org/mod/forum/discuss.php
|discussion = https://moodle.org/mod/forum/discuss.php?d=261660
|assignee = Ankit, Simey
|assignee = Ankit, Simey
}}
}}
{{Moodle 2.8}}
The Event Monitor report will allow users to select events and receive notifications in real time* when the chosen event happens.


{{Work in progress}}
This report will be built on top of the new [[Event 2]] infrastructure.


The Event Monitor tool will allow users choose their favourites events and receive notifications in real time when the choosen event is happening in the frequency and time.
== How it works ==


The main concept is to turn the new event system more usefull to teachers and admin.
* The user or site admin creates a specific set of “rules” that can be subscribed to.
* Each rule defines an event and frequency parameters.
* The users select the rules they are interested in and then subscribe to it at course level for a specific module or all modules.
* Whenever the event occurs in the system , in the frequency specified in the rule, a message is sent out to all the subscribers.
* Since we are using Moodle messaging system to send out these notifications, it can be delivered in any format supported by Moodle (Mobile notification, popup, email etc)
* There would be some default rules that would be shipped with the report, that users can subscribe to straight away.


== Benefis ==
=== User interface mock-ups ===


* Introduce the hot spot concept on moodle.
==== Subscribe to a rule ====
* Create a close relation between teachers and students.
* Real time monitoring of favourite events.
* Keep Admins aware about major changes in the system.


== Usage scenarios ==
This is the main page of the Event Monitor report where users can see a list of rules and their current subscriptions. This also lets users to subscribe to new rules or delete their current subscriptions.


* Send message to teacher when more than X posts in any forum in their course in Y minutes.
[[File:subscriptions.png]]
* Send message to teacher when assignment is submitted in their course.
* Send message to admin when a course is deleted.
* Send message to student when they are graded for activity X.
* Send message to forum poster when someone replies to their post.
* Send message to student when assignment/activity due date changes or is upcoming and they haven't submitted their submission/answer.
* Ability for a teacher to send a message to students that a particular activity has been updated (versus notify students whenever any change, such as a type being fixed).


== User interface mock-ups ==
==== Manage rules ====


'''List rules'''
This page lets you manage the rules if you have appropriate permissions (create/edit/delete/copy)


This is the main page of Event Monitor where users can list rules, subscribe to a rule, choose a specific module to monitor and delete rule.
This is roughly how the page will look like:-
In the List rule page the user have a button Add New Rule, to access a form to create a new rule.


[[File:listrules.png]]
[[File:listrules.png]]


'''Add new rule'''
==== Add/Edit a rule ====


This is the form where users can create a new rule, customize the frequency and time and create a personalized notification message.
This is the form where users can create a new rule, customise the filters (frequency and time) and personalise the notification message.


[[File:addrule.png]]
[[File:addrule.png]]


The figure above show the creation of a new rule called My Student Discussions, where the teacher add a criteria to monitor Post Created event on Forum Module.  
=== A specific example ===
 
One scenario may be that you wish to be notified when discussions are becoming active in a course's forums.
 
The figure above shows the creation of a new rule called 'My Student Discussions', which is set to monitor the 'Post Created' event, which is triggered by the 'Forum' module.  


In this case, the teacher will receive notifications every 30 posts created in 60 minutes. The user created a personalized message using a tag to receive a link to the forum.
In this case, any user subscribed to this rule will receive notifications whenever 30 posts are created in 60 minutes in forums of a course, or within a single forum that have identified in their subscription to the rule.  


== How it works ==
The notification will contain the customised message as configured in the rule.
The user identify a certain event which he want to monitor and access Site Administration > Reports > Event Monitor > Add new Rule.
 
=== Message template ===
 
One interesting option of rule addition is the message template. When creating or editing a rule, the user can embed placeholders to add details to notification messages.
 
The use of placeholders in a message template is optional, so you don't have to use placeholders; you can use any personalised message.
 
The following table lists the available placeholders that can be used in a message template.
{| class="nicetable"
! Placeholder
! What it does?
! Example
|-
| '''{link}'''
| Direct link to the actual event, eg a forum discussion.
| http://YourMoodle.com/mod/forum/discuss.php?d=2
|-
| '''{modulelink}'''
| Link to the module where the event has happened, eg a forum
| http://YourMoodle.com/mod/forum/view.php?id=8
|-
| '''{rulename}'''
| A name for the rule.
| Student discussions
|-
| '''{description}'''
| A description of the rule.
| I want to receive notifications when there is a large volume of student posts in a discussion.
|-
| '''{eventname}'''
| The name of the event being monitored.
| Forum post created.
|-
|}
The examples above show the placeholders for a rule to monitor the '''Forum post created''' event. Here is an example of a message template using these placeholders.
 
The rule '''{rulename}''', monitoring the event '''{eventname}''', has just been fulfilled.
Click the following link to go to the forum discussion: '''{link}'''
Rule description: '''{description}'''
 
The result of this message template would be as follows.
 
The rule Student discussions, monitoring the event Forum post created, has just been fulfilled.
Click on the following link to go to the forum discussion: http://YourMoodle.com/mod/forum/discuss.php?d=2 .
Rule description: I want to receive notifications when there are a large volume of student posts in a discussion.
 
Now, let's create a rule called '''Glossary entries''' to monitor when a new glossary entry is created:
 
The rule '''{rulename}''', monitoring the event '''{eventname}''', has just been fulfilled.
Click the following link to go to see the new entry created: '''{link}'''
Rule description: '''{description}'''
 
The result of this message template would be as follows.
 
The rule Glossary entries, monitoring the event Entry has been created, has just been fulfilled.
Click on the following link to go to see the new entry created: http://YourMoodle.com/mod/glossary/view.php?id=5&mode=entry&hook=1.
Rule description: I want to receive notifications when a new glossary entry is created.
 
Note that some events do not have a link.  '''Course deleted''' and '''Course module deleted''' for example, would not display any link if '''{link}''' or '''{modulelink}''' is used.
 
== Benefits ==
 
* Real time monitoring of events happening in Moodle.
* Admin can be notified when there is heavy activity on the site or they can monitor specific actions that interests them (ex:- course delete).
* A notification can be sent straight to a user's mobile if there is a situation that needs immediate attention.
* The report will be designed to trigger an event when a given subscription criteria are met. This will allow developers to build really powerful scripts on top of the report. For example, a block displaying “Hot forums”, or something more complex like load balancing when there is lot of activity in the forums or quiz.
 
== Usage scenarios ==


He must fill all fields (Name, Plugin, Event, Frequency and Time and Message Template. After fill all the fields he submit the rule and will be redirected to the List Rules.
* Send notification when more than X posts in any forum are made in a given course in Y minutes.
* Send notification when new chapters are created in a book.
* Send notification (to admin) when a course is deleted.
* Send notification  (to students) that a particular activity has been updated.
* Send notification (to admin) when potential security risk might happen due to change in system setting.


In the List Rules the user will be allowed to perform the following actions:
== Future work ==


* Select a specific module to monitor or all the modules.
* Allow events to be subscribed by only certain roles
* Subscribe or unsubscribe of a rule.
* Forced subscriptions for students for certain rules
* Create a new rule.
* An activity stream for messages
* Delete a rule.
* An facebook style notification system for notifying logged in users
* Copy rules.


== See also ==
== See also ==
Line 66: Line 137:
* [[Event 2]]
* [[Event 2]]
* Moodlerooms developed a "[http://kb.moodlerooms.com/article/81/administrator Personalized Learning Designer]" that has some of these features (mostly for individual students only).
* Moodlerooms developed a "[http://kb.moodlerooms.com/article/81/administrator Personalized Learning Designer]" that has some of these features (mostly for individual students only).
* Real time means “as soon as possible” - this depends on the cron configuration of the site. (For further information refer to [[https://docs.moodle.org/dev/Task_API#Adhoc_task_usage Adhoc tasks]])

Revision as of 06:36, 13 September 2019

Event Monitor
Project state Implemented
Tracker issue MDL-45758
Discussion https://moodle.org/mod/forum/discuss.php?d=261660
Assignee Ankit, Simey

Moodle 2.8

The Event Monitor report will allow users to select events and receive notifications in real time* when the chosen event happens.

This report will be built on top of the new Event 2 infrastructure.

How it works

  • The user or site admin creates a specific set of “rules” that can be subscribed to.
  • Each rule defines an event and frequency parameters.
  • The users select the rules they are interested in and then subscribe to it at course level for a specific module or all modules.
  • Whenever the event occurs in the system , in the frequency specified in the rule, a message is sent out to all the subscribers.
  • Since we are using Moodle messaging system to send out these notifications, it can be delivered in any format supported by Moodle (Mobile notification, popup, email etc)
  • There would be some default rules that would be shipped with the report, that users can subscribe to straight away.

User interface mock-ups

Subscribe to a rule

This is the main page of the Event Monitor report where users can see a list of rules and their current subscriptions. This also lets users to subscribe to new rules or delete their current subscriptions.

subscriptions.png

Manage rules

This page lets you manage the rules if you have appropriate permissions (create/edit/delete/copy)

This is roughly how the page will look like:-

listrules.png

Add/Edit a rule

This is the form where users can create a new rule, customise the filters (frequency and time) and personalise the notification message.

addrule.png

A specific example

One scenario may be that you wish to be notified when discussions are becoming active in a course's forums.

The figure above shows the creation of a new rule called 'My Student Discussions', which is set to monitor the 'Post Created' event, which is triggered by the 'Forum' module.

In this case, any user subscribed to this rule will receive notifications whenever 30 posts are created in 60 minutes in forums of a course, or within a single forum that have identified in their subscription to the rule.

The notification will contain the customised message as configured in the rule.

Message template

One interesting option of rule addition is the message template. When creating or editing a rule, the user can embed placeholders to add details to notification messages.

The use of placeholders in a message template is optional, so you don't have to use placeholders; you can use any personalised message.

The following table lists the available placeholders that can be used in a message template.

Placeholder What it does? Example
{link} Direct link to the actual event, eg a forum discussion. http://YourMoodle.com/mod/forum/discuss.php?d=2
{modulelink} Link to the module where the event has happened, eg a forum http://YourMoodle.com/mod/forum/view.php?id=8
{rulename} A name for the rule. Student discussions
{description} A description of the rule. I want to receive notifications when there is a large volume of student posts in a discussion.
{eventname} The name of the event being monitored. Forum post created.

The examples above show the placeholders for a rule to monitor the Forum post created event. Here is an example of a message template using these placeholders.

The rule {rulename}, monitoring the event {eventname}, has just been fulfilled. 
Click the following link to go to the forum discussion: {link}
Rule description: {description}

The result of this message template would be as follows.

The rule Student discussions, monitoring the event Forum post created, has just been fulfilled. 
Click on the following link to go to the forum discussion: http://YourMoodle.com/mod/forum/discuss.php?d=2 .
Rule description: I want to receive notifications when there are a large volume of student posts in a discussion.

Now, let's create a rule called Glossary entries to monitor when a new glossary entry is created:

The rule {rulename}, monitoring the event {eventname}, has just been fulfilled. 
Click the following link to go to see the new entry created: {link}
Rule description: {description}

The result of this message template would be as follows.

The rule Glossary entries, monitoring the event Entry has been created, has just been fulfilled. 
Click on the following link to go to see the new entry created: http://YourMoodle.com/mod/glossary/view.php?id=5&mode=entry&hook=1.
Rule description: I want to receive notifications when a new glossary entry is created.

Note that some events do not have a link. Course deleted and Course module deleted for example, would not display any link if {link} or {modulelink} is used.

Benefits

  • Real time monitoring of events happening in Moodle.
  • Admin can be notified when there is heavy activity on the site or they can monitor specific actions that interests them (ex:- course delete).
  • A notification can be sent straight to a user's mobile if there is a situation that needs immediate attention.
  • The report will be designed to trigger an event when a given subscription criteria are met. This will allow developers to build really powerful scripts on top of the report. For example, a block displaying “Hot forums”, or something more complex like load balancing when there is lot of activity in the forums or quiz.

Usage scenarios

  • Send notification when more than X posts in any forum are made in a given course in Y minutes.
  • Send notification when new chapters are created in a book.
  • Send notification (to admin) when a course is deleted.
  • Send notification (to students) that a particular activity has been updated.
  • Send notification (to admin) when potential security risk might happen due to change in system setting.

Future work

  • Allow events to be subscribed by only certain roles
  • Forced subscriptions for students for certain rules
  • An activity stream for messages
  • An facebook style notification system for notifying logged in users

See also

  • Event 2
  • Moodlerooms developed a "Personalized Learning Designer" that has some of these features (mostly for individual students only).
  • Real time means “as soon as possible” - this depends on the cron configuration of the site. (For further information refer to [Adhoc tasks])