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

Add Event monitor to Advanced settings and turn off by default

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.8
    • 2.8
    • Reports
    • MOODLE_28_STABLE
    • MOODLE_28_STABLE
    • MDL-47922-master
    • Hide

      Testing the UI

      1. As admin go to site admin>reports>Event monitoring
      2. Make sure you get a message saying event monitor is disabled and a link do enable it. (Don't click the link yet)
      3. Make sure there is no event monitoring related nodes in the following places:-
        1. In my profile settings at site level
        2. in my profile settings at course level
        3. in course>reports at course level
          (Note: some parts of navigation might be cached, refresh to be sure)
      4. Now log out and log in as teacher. Make sure you don't see anything in navigation as mentioned in the previous step.
      5. Log back in as admin and enable event monitoring.
      6. Make sure the nagivation nodes appear now.
      7. Try a few actions like creating/editing/deleting rules etc and make sure it is fine.
      8. Log in as teacher and try similar acitons and make sure everything works.
      9. Test subscribing to an rule you created and executing the criteria you set and make sure you get a notification, for example visit a book chapter if the rule you scribed to is for "Chapter viewed" with a frequency of 1/1
        (You might need to update message settings if you don't have email setup properly and execute the cron to get the notification)
      10. Create a user with following permission at system context
        'monitor:managerules'
        'monitor:subscribe'
        And not 'monitor:managetool'
      11. Login as this user and visit site admin>reports>Event monitoring. Make sure you get a message saying:-
        Event monitoring is currently disabled. Contact your administrator to enable it.

      Testing the background action

      1. Basically we need to make sure the observer and the scheduled task doesn't do anything when the plugin is disabled. The simplest way I would suggest is to add error_log() calls to :-
        \tool_monitor\eventobservers::process_event
        \tool_monitor\task\clean_events::execute
        Add the calls right after the "if statement" that says "
        The tool is disabled. Nothing to do."
      2. Now perform various actions that generate multiple events, creating,deleting users, visiting activities etc
      3. Run the cron multiple times
      4. Now check your error log and make sure nothing is displayed related to the code that you added above.

      New install
      Do a fresh install of Moodle with this patch in place and make sure Event monitoring is disabled by default.

      Tests
      Run unit tests and behat tests and make sure they pass.

      Show
      Testing the UI As admin go to site admin>reports>Event monitoring Make sure you get a message saying event monitor is disabled and a link do enable it. (Don't click the link yet) Make sure there is no event monitoring related nodes in the following places:- In my profile settings at site level in my profile settings at course level in course>reports at course level (Note: some parts of navigation might be cached, refresh to be sure) Now log out and log in as teacher. Make sure you don't see anything in navigation as mentioned in the previous step. Log back in as admin and enable event monitoring. Make sure the nagivation nodes appear now. Try a few actions like creating/editing/deleting rules etc and make sure it is fine. Log in as teacher and try similar acitons and make sure everything works. Test subscribing to an rule you created and executing the criteria you set and make sure you get a notification, for example visit a book chapter if the rule you scribed to is for "Chapter viewed" with a frequency of 1/1 (You might need to update message settings if you don't have email setup properly and execute the cron to get the notification) Create a user with following permission at system context 'monitor:managerules' 'monitor:subscribe' And not 'monitor:managetool' Login as this user and visit site admin>reports>Event monitoring. Make sure you get a message saying:- Event monitoring is currently disabled. Contact your administrator to enable it. Testing the background action Basically we need to make sure the observer and the scheduled task doesn't do anything when the plugin is disabled. The simplest way I would suggest is to add error_log() calls to :- \tool_monitor\eventobservers::process_event \tool_monitor\task\clean_events::execute Add the calls right after the "if statement" that says " The tool is disabled. Nothing to do." Now perform various actions that generate multiple events, creating,deleting users, visiting activities etc Run the cron multiple times Now check your error log and make sure nothing is displayed related to the code that you added above. New install Do a fresh install of Moodle with this patch in place and make sure Event monitoring is disabled by default. Tests Run unit tests and behat tests and make sure they pass.

      While the Event monitor is a great addition, it may be unnecessary for many users and it may therefore cause unnecessary load.

      There should be an option added to the Advanced settings page to control the functionality of the Event Monitor. This should control the Scheduled tasks and background processing, as well as the appearance of links to the Event Monitor in navigation.

            ankit_frenz Ankit Agarwal
            salvetore Michael de Raadt
            David Monllaó David Monllaó
            Dan Poltawski Dan Poltawski
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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