June 2017
Beginner to intermediate
368 pages
8h 31m
English
In the \events folder are scripts that will allow our new plugin to support for the Moodle events system: in this case, for recording user interactions to the Moodle log. Take a look at the Moodle documentation at https://docs.moodle.org/dev/Event_2. These scripts are the event dispatchers, with each dispatcher in a separate file (as they are auto loaded by Moodle on the fly). Event dispatchers are essentially classes that are all extensions of the \core\event\base class. For example, when a choice is submitted the answerupdated event is triggered. Here is the code in \lib.php that creates and triggers this event:
// Now record completed event. if (isset($answerupdated)) { $eventdata = array(); $eventdata['context'] = $context; ...Read now
Unlock full access