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

Add Event monitor to Advanced settings and turn off by default

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8
    • Component/s: Reports
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-47922-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14