���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home3/cpr76684/public_html/event.tar
���ѧ٧ѧ�
audience_updated.php 0000644 00000006421 15151251671 0010547 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\audience; use moodle_url; /** * Report builder custom report audience created event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - int reportid: The id of the report * } */ class audience_updated extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = audience::TABLE; $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report audience object * * @param audience $audience * @return self */ public static function create_from_object(audience $audience): self { $eventparams = [ 'context' => $audience->get_report()->get_context(), 'objectid' => $audience->get('id'), 'other' => [ 'reportid' => $audience->get('reportid'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $audience->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('audienceupdated', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { $reportid = $this->other['reportid']; return "The user with id '$this->userid' updated the audience with id '$this->objectid' in the custom report" . " with id '$reportid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } if (!isset($this->other['reportid'])) { throw new coding_exception('The \'reportid\' must be set in other.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->other['reportid']], 'audience'); } } report_viewed.php 0000644 00000007625 15151251671 0010151 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The report_log report viewed event. * * @package report_log * @copyright 2013 Ankit Agarwal * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace report_log\event; defined('MOODLE_INTERNAL') || die(); /** * The report_log report viewed event class. * * @property-read array $other { * Extra information about the event. * * - int groupid: Group to display. * - int date: Date to display logs from. * - int modid: Module id for which logs were displayed. * - string modaction: Module action. * - string logformat: Log format in which logs were displayed. * } * * @package report_log * @since Moodle 2.7 * @copyright 2013 Ankit Agarwal * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class report_viewed extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'r'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventreportviewed', 'report_log'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' viewed the log report for the course with id '$this->courseid'."; } /** * Return the legacy event log data. * * @return array */ protected function get_legacy_logdata() { return array($this->courseid, "course", "report log", "report/log/index.php?id=$this->courseid", $this->courseid); } /** * Returns relevant URL. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/report/log/index.php', array('id' => $this->courseid)); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['groupid'])) { throw new \coding_exception('The \'groupid\' value must be set in other.'); } if (!isset($this->other['date'])) { throw new \coding_exception('The \'date\' value must be set in other.'); } if (!isset($this->other['modid'])) { throw new \coding_exception('The \'modid\' value must be set in other.'); } if (!isset($this->other['modaction'])) { throw new \coding_exception('The \'modaction\' value must be set in other.'); } if (!isset($this->other['logformat'])) { throw new \coding_exception('The \'logformat\' value must be set in other.'); } if (!isset($this->relateduserid)) { throw new \coding_exception('The \'relateduserid\' must be set.'); } } public static function get_other_mapping() { $othermapped = array(); $othermapped['modid'] = array('db' => 'course_modules', 'restore' => 'course_module'); $othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group'); return $othermapped; } } report_updated.php 0000644 00000006077 15151251671 0010314 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\report; use moodle_url; /** * Report builder custom report updated event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - string name: The name of the report * - string source: The report source class * } */ class report_updated extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = report::TABLE; $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report object * * @param report $report * @return self */ public static function create_from_object(report $report): self { $eventparams = [ 'context' => $report->get_context(), 'objectid' => $report->get('id'), 'other' => [ 'name' => $report->get('name'), 'source' => $report->get('source'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $report->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('reportupdated', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' updated the custom report with id '$this->objectid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->objectid]); } } report_created.php 0000644 00000006077 15151251671 0010275 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\report; use moodle_url; /** * Report builder custom report created event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - string name: The name of the report * - string source: The report source class * } */ class report_created extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = report::TABLE; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report object * * @param report $report * @return self */ public static function create_from_object(report $report): self { $eventparams = [ 'context' => $report->get_context(), 'objectid' => $report->get('id'), 'other' => [ 'name' => $report->get('name'), 'source' => $report->get('source'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $report->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('reportcreated', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' created the custom report with id '$this->objectid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->objectid]); } } schedule_updated.php 0000644 00000006422 15151251671 0010567 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\schedule; use moodle_url; /** * Report builder custom report schedule updated event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - int reportid: The id of the report * } */ class schedule_updated extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = schedule::TABLE; $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report schedule object * * @param schedule $schedule * @return self */ public static function create_from_object(schedule $schedule): self { $eventparams = [ 'context' => $schedule->get_report()->get_context(), 'objectid' => $schedule->get('id'), 'other' => [ 'reportid' => $schedule->get('reportid'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $schedule->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('scheduleupdated', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { $reportid = $this->other['reportid']; return "The user with id '$this->userid' updated the schedule with id '$this->objectid' in the custom report" . " with id '$reportid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } if (!isset($this->other['reportid'])) { throw new coding_exception('The \'reportid\' must be set in other.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->other['reportid']], 'schedules'); } } report_deleted.php 0000644 00000005531 15151251671 0010266 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\report; /** * Report builder custom report deleted event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - string name: The name of the report * - string source: The report source class * } */ class report_deleted extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = report::TABLE; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report object * * @param report $report * @return self */ public static function create_from_object(report $report): self { $eventparams = [ 'context' => $report->get_context(), 'objectid' => $report->get('id'), 'other' => [ 'name' => $report->get('name'), 'source' => $report->get('source'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $report->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('reportdeleted', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' deleted the custom report with id '$this->objectid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } } } audience_created.php 0000644 00000006345 15151251671 0010535 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\audience; use moodle_url; /** * Report builder custom report audience created event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - int reportid: The id of the report * } */ class audience_created extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = audience::TABLE; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report audience object * * @param audience $audience * @return self */ public static function create_from_object(audience $audience): self { $eventparams = [ 'context' => $audience->get_report()->get_context(), 'objectid' => $audience->get('id'), 'other' => [ 'reportid' => $audience->get('reportid'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $audience->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('audiencecreated', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { $reportid = $this->other['reportid']; return "The user with id '$this->userid' created an audience in the custom report with id '$reportid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } if (!isset($this->other['reportid'])) { throw new coding_exception('The \'reportid\' must be set in other.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->other['reportid']], 'audience'); } } schedule_created.php 0000644 00000006345 15151251671 0010554 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\schedule; use moodle_url; /** * Report builder custom report schedule created event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - int reportid: The id of the report * } */ class schedule_created extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = schedule::TABLE; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report schedule object * * @param schedule $schedule * @return self */ public static function create_from_object(schedule $schedule): self { $eventparams = [ 'context' => $schedule->get_report()->get_context(), 'objectid' => $schedule->get('id'), 'other' => [ 'reportid' => $schedule->get('reportid'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $schedule->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('schedulecreated', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { $reportid = $this->other['reportid']; return "The user with id '$this->userid' created a schedule in the custom report with id '$reportid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } if (!isset($this->other['reportid'])) { throw new coding_exception('The \'reportid\' must be set in other.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->other['reportid']], 'schedules'); } } audience_deleted.php 0000644 00000006426 15151251671 0010534 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\audience; use moodle_url; /** * Report builder custom report audience deleted event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - int reportid: The id of the report * } */ class audience_deleted extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = audience::TABLE; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report audience object * * @param audience $audience * @return self */ public static function create_from_object(audience $audience): self { $eventparams = [ 'context' => $audience->get_report()->get_context(), 'objectid' => $audience->get('id'), 'other' => [ 'reportid' => $audience->get('reportid'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $audience->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('audiencedeletedevent', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { $reportid = $this->other['reportid']; return "The user with id '$this->userid' deleted the audience with id '$this->objectid' in the custom report" . " with id '$reportid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } if (!isset($this->other['reportid'])) { throw new coding_exception('The \'reportid\' must be set in other.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->other['reportid']], 'audience'); } } schedule_deleted.php 0000644 00000006422 15151251671 0010547 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. declare(strict_types=1); namespace core_reportbuilder\event; use coding_exception; use core\event\base; use core_reportbuilder\local\models\schedule; use moodle_url; /** * Report builder custom report schedule created event class. * * @package core_reportbuilder * @copyright 2021 David Matamoros <davidmc@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * * @property-read array $other { * Extra information about the event. * * - int reportid: The id of the report * } */ class schedule_deleted extends base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = schedule::TABLE; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a report schedule object * * @param schedule $schedule * @return self */ public static function create_from_object(schedule $schedule): self { $eventparams = [ 'context' => $schedule->get_report()->get_context(), 'objectid' => $schedule->get('id'), 'other' => [ 'reportid' => $schedule->get('reportid'), ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $schedule->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('scheduledeleted', 'core_reportbuilder'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { $reportid = $this->other['reportid']; return "The user with id '$this->userid' deleted the schedule with id '$this->objectid' in the custom report" . " with id '$reportid'."; } /** * Custom validations. * * @throws coding_exception */ protected function validate_data(): void { parent::validate_data(); if (!isset($this->objectid)) { throw new coding_exception('The \'objectid\' must be set.'); } if (!isset($this->other['reportid'])) { throw new coding_exception('The \'reportid\' must be set in other.'); } } /** * Returns relevant URL. * * @return moodle_url */ public function get_url(): moodle_url { return new moodle_url('/reportbuilder/edit.php', ['id' => $this->other['reportid']], 'schedules'); } } course_bin_item_deleted.php 0000644 00000003510 15151252423 0012110 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Recycle bin events. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_recyclebin\event; defined('MOODLE_INTERNAL') || die(); /** * Event class. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class course_bin_item_deleted extends \core\event\base { /** * Init method. */ protected function init() { $this->data['objecttable'] = 'tool_recyclebin_course'; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventitemdeleted', 'tool_recyclebin'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return get_string('eventitemdeleted_desc', 'tool_recyclebin', array( 'objectid' => $this->objectid )); } } category_bin_item_deleted.php 0000644 00000003514 15151252423 0012431 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Recycle bin events. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_recyclebin\event; defined('MOODLE_INTERNAL') || die(); /** * Event class. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class category_bin_item_deleted extends \core\event\base { /** * Init method. */ protected function init() { $this->data['objecttable'] = 'tool_recyclebin_category'; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventitemdeleted', 'tool_recyclebin'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return get_string('eventitemdeleted_desc', 'tool_recyclebin', array( 'objectid' => $this->objectid )); } } course_bin_item_created.php 0000644 00000003510 15151252423 0012111 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Recycle bin events. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_recyclebin\event; defined('MOODLE_INTERNAL') || die(); /** * Event class. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class course_bin_item_created extends \core\event\base { /** * Init method. */ protected function init() { $this->data['objecttable'] = 'tool_recyclebin_course'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventitemcreated', 'tool_recyclebin'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return get_string('eventitemcreated_desc', 'tool_recyclebin', array( 'objectid' => $this->objectid )); } } course_bin_item_restored.php 0000644 00000003513 15151252423 0012334 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Recycle bin events. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_recyclebin\event; defined('MOODLE_INTERNAL') || die(); /** * Event class. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class course_bin_item_restored extends \core\event\base { /** * Init method. */ protected function init() { $this->data['objecttable'] = 'tool_recyclebin_course'; $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventitemrestored', 'tool_recyclebin'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return get_string('eventitemrestored_desc', 'tool_recyclebin', array( 'objectid' => $this->objectid )); } } category_bin_item_restored.php 0000644 00000003516 15151252423 0012654 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Recycle bin events. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_recyclebin\event; defined('MOODLE_INTERNAL') || die(); /** * Event Class * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class category_bin_item_restored extends \core\event\base { /** * Init method. */ protected function init() { $this->data['objecttable'] = 'tool_recyclebin_category'; $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventitemrestored', 'tool_recyclebin'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return get_string('eventitemrestored_desc', 'tool_recyclebin', array( 'objectid' => $this->objectid )); } } category_bin_item_created.php 0000644 00000003514 15151252423 0012432 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Recycle bin events. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_recyclebin\event; defined('MOODLE_INTERNAL') || die(); /** * Event class. * * @package tool_recyclebin * @copyright 2015 University of Kent * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class category_bin_item_created extends \core\event\base { /** * Init method. */ protected function init() { $this->data['objecttable'] = 'tool_recyclebin_category'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventitemcreated', 'tool_recyclebin'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return get_string('eventitemcreated_desc', 'tool_recyclebin', array( 'objectid' => $this->objectid )); } } events_test.php 0000644 00000020760 15151776602 0007637 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. namespace core_my\event; use context_system; use context_user; /** * Unit tests for the dashboard events. * * @package core * @category test * @copyright 2016 Stephen Bourget * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class events_test extends \advanced_testcase { /** @var user cobject */ protected $user; /** * Setup often used objects for the following tests. */ protected function setUp(): void { global $USER; $this->resetAfterTest(); // The user we are going to test this on. $this->setAdminUser(); $this->user = $USER; } /** * Test the dashboard viewed event. * * There is no external API for viewing the dashboard, so the unit test will simply * create and trigger the event and ensure data is returned as expected. */ public function test_dashboard_viewed() { $user = $this->user; // Trigger an event: dashboard viewed. $eventparams = array( 'context' => $context = \context_user::instance($user->id) ); $event = \core\event\dashboard_viewed::create($eventparams); // Trigger and capture the event. $sink = $this->redirectEvents(); $event->trigger(); $events = $sink->get_events(); $event = reset($events); // Check that the event data is valid. $this->assertInstanceOf('\core\event\dashboard_viewed', $event); $this->assertEquals($user->id, $event->userid); $this->assertDebuggingNotCalled(); } /** * Test the dashboard reset event. * * We will reset the user dashboard to * trigger the event and ensure data is returned as expected. * * @covers ::my_reset_page */ public function test_dashboard_reset() { global $CFG, $DB; require_once($CFG->dirroot . '/my/lib.php'); $user = $this->user; $usercontext = context_user::instance($this->user->id); // Create at least one dashboard. my_copy_page($this->user->id); $this->assertNotEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PRIVATE, 'name' => MY_PAGE_DEFAULT])); $this->assertNotEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); // Reset the dashboard. $sink = $this->redirectEvents(); my_reset_page($user->id); // Assert that the page and all th blocks were deleted. $this->assertEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PRIVATE, 'name' => MY_PAGE_DEFAULT])); $this->assertEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); // Trigger and capture the event. $events = $sink->get_events(); $event = reset($events); $sink->close(); // Check that the event data is valid. $this->assertInstanceOf('\core\event\dashboard_reset', $event); $this->assertEquals($user->id, $event->userid); $this->assertEquals(MY_PAGE_PRIVATE, $event->other['private']); $this->assertEquals('my-index', $event->other['pagetype']); $this->assertDebuggingNotCalled(); // Reset the dashboard with private parameter is set to MY_PAGE_PUBLIC and pagetype set to 'user-profile'. $systempage = $DB->get_record('my_pages', ['userid' => null, 'name' => MY_PAGE_DEFAULT, 'private' => MY_PAGE_PUBLIC]); $this->getDataGenerator()->create_block('online_users', [ 'parentcontextid' => context_system::instance()->id, 'pagetypepattern' => 'user-profile', 'subpagepattern' => $systempage->id, ]); my_copy_page($this->user->id, MY_PAGE_PUBLIC, 'user-profile'); $this->assertNotEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PUBLIC, 'name' => MY_PAGE_DEFAULT])); $this->assertNotEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); $sink = $this->redirectEvents(); my_reset_page($user->id, MY_PAGE_PUBLIC, 'user-profile'); $this->assertEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PUBLIC, 'name' => MY_PAGE_DEFAULT])); $this->assertEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); // Trigger and capture the event. $events = $sink->get_events(); $event = reset($events); $sink->close(); $this->assertEquals(MY_PAGE_PUBLIC, $event->other['private']); $this->assertEquals('user-profile', $event->other['pagetype']); } /** * Test the dashboards reset event. * * We will reset all user dashboards to * trigger the event and ensure data is returned as expected. * * @covers ::my_reset_page_for_all_users */ public function test_dashboards_reset() { global $CFG, $USER, $DB; require_once($CFG->dirroot . '/my/lib.php'); $usercontext = context_user::instance($this->user->id); // Create at least one dashboard. my_copy_page($this->user->id); $this->assertNotEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PRIVATE, 'name' => MY_PAGE_DEFAULT])); $this->assertNotEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); // Reset all dashbaords. $sink = $this->redirectEvents(); my_reset_page_for_all_users(); // Assert that the page and all th blocks were deleted. $this->assertEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PRIVATE, 'name' => MY_PAGE_DEFAULT])); $this->assertEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); // Trigger and capture the event. $events = $sink->get_events(); $event = reset($events); $sink->close(); // Check that the event data is valid. $this->assertInstanceOf('\core\event\dashboards_reset', $event); $this->assertEquals($USER->id, $event->userid); $this->assertEquals(MY_PAGE_PRIVATE, $event->other['private']); $this->assertEquals('my-index', $event->other['pagetype']); $this->assertDebuggingNotCalled(); // Reset the dashboards with private parameter is set to MY_PAGE_PUBLIC and pagetype set to 'user-profile'. $systempage = $DB->get_record('my_pages', ['userid' => null, 'name' => MY_PAGE_DEFAULT, 'private' => MY_PAGE_PUBLIC]); $this->getDataGenerator()->create_block('online_users', [ 'parentcontextid' => context_system::instance()->id, 'pagetypepattern' => 'user-profile', 'subpagepattern' => $systempage->id, ]); my_copy_page($this->user->id, MY_PAGE_PUBLIC, 'user-profile'); $this->assertNotEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PUBLIC, 'name' => MY_PAGE_DEFAULT])); $this->assertNotEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); $sink = $this->redirectEvents(); my_reset_page_for_all_users(MY_PAGE_PUBLIC, 'user-profile'); $this->assertEmpty($DB->get_records('my_pages', ['userid' => $this->user->id, 'private' => MY_PAGE_PUBLIC, 'name' => MY_PAGE_DEFAULT])); $this->assertEmpty($DB->get_records('block_instances', ['parentcontextid' => $usercontext->id])); // Trigger and capture the event. $events = $sink->get_events(); $event = reset($events); $sink->close(); $this->assertEquals(MY_PAGE_PUBLIC, $event->other['private']); $this->assertEquals('user-profile', $event->other['pagetype']); } } langpack_imported.php 0000644 00000006476 15152020100 0010737 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The langimport langpack imported event. * * @package tool_langimport * @copyright 2014 Dan Poltawski <dan@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_langimport\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_langimport langpack imported event class. * * @property-read array $other { * Extra information about event. * * - string langcode: the langpage pack code. * } * * @package tool_langimport * @since Moodle 2.8 * @copyright 2014 Dan Poltawski <dan@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class langpack_imported extends \core\event\base { /** * Create instance of event. * * @param string $langcode * @return langpack_updated */ public static function event_with_langcode($langcode) { $data = array( 'context' => \context_system::instance(), 'other' => array( 'langcode' => $langcode, ) ); return self::create($data); } /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The language pack '{$this->other['langcode']}' was installed."; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('langpackinstalledevent', 'tool_langimport'); } /** * Returns relevant URL. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/admin/tool/langimport/'); } /** * Custom validation. * * @throws \coding_exception */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['langcode'])) { throw new \coding_exception('The \'langcode\' value must be set'); } // We can't use PARAM_LANG here as the string manager might not be aware of langpack yet. $cleanedlang = clean_param($this->other['langcode'], PARAM_SAFEDIR); if ($cleanedlang !== $this->other['langcode']) { throw new \coding_exception('The \'langcode\' value must be set to a valid language code'); } } public static function get_other_mapping() { // No mapping required for this event because this event is not backed up. return false; } } langpack_updated.php 0000644 00000006323 15152020100 0010531 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The langimport langpack updated event. * * @package tool_langimport * @copyright 2014 Dan Poltawski <dan@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_langimport\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_langimport langpack updated event class. * * @property-read array $other { * Extra information about event. * * - string langcode: the langpage pack code. * } * * @package tool_langimport * @since Moodle 2.8 * @copyright 2014 Dan Poltawski <dan@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class langpack_updated extends \core\event\base { /** * Create instance of event. * * @param string $langcode * @return langpack_updated */ public static function event_with_langcode($langcode) { $data = array( 'context' => \context_system::instance(), 'other' => array( 'langcode' => $langcode, ) ); return self::create($data); } /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The language pack '{$this->other['langcode']}' was updated."; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('langpackupdatedevent', 'tool_langimport'); } /** * Returns relevant URL. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/admin/tool/langimport/'); } /** * Custom validation. * * @throws \coding_exception */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['langcode'])) { throw new \coding_exception('The \'langcode\' value must be set'); } $cleanedlang = clean_param($this->other['langcode'], PARAM_LANG); if ($cleanedlang !== $this->other['langcode']) { throw new \coding_exception('The \'langcode\' value must be set to a valid language code'); } } public static function get_other_mapping() { // No mapping required for this event because this event is not backed up. return false; } } langpack_removed.php 0000644 00000006437 15152020100 0010552 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The langimport langpack removed event. * * @package tool_langimport * @copyright 2014 Dan Poltawski <dan@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_langimport\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_langimport langpack removed event class. * * @property-read array $other { * Extra information about event. * * - string langcode: the langpage pack code. * } * * @package tool_langimport * @since Moodle 2.8 * @copyright 2014 Dan Poltawski <dan@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class langpack_removed extends \core\event\base { /** * Create instance of event. * * @param string $langcode * @return langpack_updated */ public static function event_with_langcode($langcode) { $data = array( 'context' => \context_system::instance(), 'other' => array( 'langcode' => $langcode, ) ); return self::create($data); } /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The language pack '{$this->other['langcode']}' was removed."; } /** * Returns relevant URL. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/admin/tool/langimport/'); } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('langpackremovedevent', 'tool_langimport'); } /** * Custom validation. * * @throws \coding_exception */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['langcode'])) { throw new \coding_exception('The \'langcode\' value must be set'); } // We can't use PARAM_LANG here as it queries installed strings. $cleanedlang = clean_param($this->other['langcode'], PARAM_SAFEDIR); if ($cleanedlang !== $this->other['langcode']) { throw new \coding_exception('The \'langcode\' value must be set to a valid language code'); } } public static function get_other_mapping() { // No mapping required for this event because this event is not backed up. return false; } } answer_submitted.php 0000644 00000011652 15152034674 0010650 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_choice answer submitted event. * * @package mod_choice * @copyright 2013 Adrian Greeve <adrian@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_choice\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_choice answer submitted event class. * * This event is deprecated in Moodle 3.2, it can no longer be triggered, do not * write event observers for it. This event can only be initiated during * restore from previous Moodle versions and appear in the logs. * * Event observers should listen to mod_choice\event\answer_created instead that * will be triggered once for each option selected * * @property-read array $other { * Extra information about event. * * - int choiceid: id of choice. * - int optionid: (optional) id of option. * } * * @deprecated since 3.2 * @package mod_choice * @since Moodle 2.6 * @copyright 2013 Adrian Greeve <adrian@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class answer_submitted extends \core\event\base { /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' made the choice with id '$this->objectid' in the choice activity with course module id '$this->contextinstanceid'."; } /** * Return legacy data for add_to_log(). * * @return array */ protected function get_legacy_logdata() { $legacylogdata = array($this->courseid, 'choice', 'choose', 'view.php?id=' . $this->contextinstanceid, $this->other['choiceid'], $this->contextinstanceid); return $legacylogdata; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventanswersubmitted', 'mod_choice'); } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/choice/view.php', array('id' => $this->contextinstanceid)); } /** * Init method. * * @return void */ protected function init() { // The objecttable here is wrong. We are submitting an answer, not a choice activity. // This also makes the description misleading as it states we made a choice with id // '$this->objectid' which just refers to the 'choice' table. The trigger for // this event should be triggered after we insert to the 'choice_answers' table. $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'choice'; } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); debugging('Event \\mod_choice\event\\answer_submitted should not be used ' . 'any more for triggering new events and can only be initiated during restore. ' . 'For new events please use \\mod_choice\\event\\answer_created', DEBUG_DEVELOPER); if (!isset($this->other['choiceid'])) { throw new \coding_exception('The \'choiceid\' value must be set in other.'); } } public static function get_objectid_mapping() { return array('db' => 'choice', 'restore' => 'choice'); } public static function get_other_mapping() { $othermapped = array(); $othermapped['choiceid'] = array('db' => 'choice', 'restore' => 'choice'); // The 'optionid' is being passed as an array, so we can't map it. The event is // triggered each time a choice is answered, where it may be possible to select // multiple choices, so the value is converted to an array, which is then passed // to the event. Ideally this event should be triggered every time we insert to the // 'choice_answers' table so this will only be an int. $othermapped['optionid'] = \core\event\base::NOT_MAPPED; return $othermapped; } public static function is_deprecated() { return true; } } answer_updated.php 0000644 00000012054 15152034674 0010273 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_choice answer updated event. * * @package mod_choice * @copyright 2013 Adrian Greeve <adrian@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_choice\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_choice answer updated event class. * * This event is deprecated in Moodle 3.2, it can no longer be triggered, do not * write event observers for it. This event can only be initiated during * restore from previous Moodle versions and appear in the logs. * * Event observers should listen to mod_choice\event\answer_created and * mod_choice\event\answer_deleted instead, these events will be triggered for * each option that was user has selected or unselected * * @property-read array $other { * Extra information about event. * * - int choiceid: id of choice. * - int optionid: (optional) id of option. * } * * @deprecated since 3.2 * @package mod_choice * @since Moodle 2.6 * @copyright 2013 Adrian Greeve <adrian@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class answer_updated extends \core\event\base { /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' updated their choice with id '$this->objectid' in the choice activity with course module id '$this->contextinstanceid'."; } /** * Return legacy data for add_to_log(). * * @return array */ protected function get_legacy_logdata() { $legacylogdata = array($this->courseid, 'choice', 'choose again', 'view.php?id=' . $this->contextinstanceid, $this->other['choiceid'], $this->contextinstanceid); return $legacylogdata; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventanswerupdated', 'mod_choice'); } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/choice/view.php', array('id' => $this->contextinstanceid)); } /** * Init method. * * @return void */ protected function init() { // The objecttable here is wrong. We are updating an answer, not a choice activity. // This also makes the description misleading as it states we made a choice with id // '$this->objectid' which just refers to the 'choice' table. The trigger for // this event should be triggered after we update the 'choice_answers' table. $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'choice'; } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); debugging('Event \\mod_choice\event\\answer_updated should not be used ' . 'any more for triggering new events and can only be initiated during restore. ' . 'For new events please use \\mod_choice\\event\\answer_created ' . 'and \\mod_choice\\event\\answer_deleted', DEBUG_DEVELOPER); if (!isset($this->other['choiceid'])) { throw new \coding_exception('The \'choiceid\' value must be set in other.'); } } public static function get_objectid_mapping() { return array('db' => 'choice', 'restore' => 'choice'); } public static function get_other_mapping() { $othermapped = array(); $othermapped['choiceid'] = array('db' => 'choice', 'restore' => 'choice'); // The 'optionid' is being passed as an array, so we can't map it. The event is // triggered each time a choice is answered, where it may be possible to select // multiple choices, so the value is converted to an array, which is then passed // to the event. Ideally this event should be triggered every time we update the // 'choice_answers' table so this will only be an int. $othermapped['optionid'] = \core\event\base::NOT_MAPPED; return $othermapped; } public static function is_deprecated() { return true; } } report_downloaded.php 0000644 00000006445 15152034674 0011010 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_choice report viewed event. * * @package mod_choice * @copyright 2016 Stephen Bourget * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_choice\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_choice report viewed event class. * * @property-read array $other { * Extra information about the event. * * - string content: The content we are viewing. * - string format: The report format * - int choiced: The id of the choice * } * * @package mod_choice * @since Moodle 3.1 * @copyright 2016 Stephen Bourget * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class report_downloaded extends \core\event\base { /** * Init method. */ protected function init() { $this->data['crud'] = 'r'; $this->data['edulevel'] = self::LEVEL_TEACHING; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventreportdownloaded', 'mod_choice'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has downloaded the report in the '".$this->other['format']."' format for the choice activity with course module id '$this->contextinstanceid'"; } /** * Returns relevant URL. * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/choice/report.php', array('id' => $this->contextinstanceid)); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); // Report format downloaded. if (!isset($this->other['content'])) { throw new \coding_exception('The \'content\' value must be set in other.'); } // Report format downloaded. if (!isset($this->other['format'])) { throw new \coding_exception('The \'format\' value must be set in other.'); } // ID of the choice activity. if (!isset($this->other['choiceid'])) { throw new \coding_exception('The \'choiceid\' value must be set in other.'); } } public static function get_objectid_mapping() { return false; } public static function get_other_mapping() { $othermapped = array(); $othermapped['choiceid'] = array('db' => 'choice', 'restore' => 'choice'); return $othermapped; } } course_module_instance_list_viewed.php 0000644 00000002412 15152034674 0014412 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * H5P Activity list viewed event. * * @package mod_h5pactivity * @copyright 2020 Ferran Recio <ferran@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\event; defined('MOODLE_INTERNAL') || die(); /** * The course_module_instance_list_viewed event class. * * @package mod_h5pactivity * @copyright 2020 Ferran Recio <ferran@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed { } course_module_viewed.php 0000644 00000003412 15152034674 0011474 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * H5P activity viewed. * * @package mod_h5pactivity * @copyright 2020 Ferran Recio <ferran@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\event; defined('MOODLE_INTERNAL') || die(); /** * The course_module_viewed event class. * * @package mod_h5pactivity * @copyright 2020 Ferran Recio <ferran@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class course_module_viewed extends \core\event\course_module_viewed { /** * Init method. * * @return void */ protected function init(): void { $this->data['objecttable'] = 'h5pactivity'; $this->data['crud'] = 'r'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; } /** * This is used when restoring course logs where it is required that we * map the objectid to it's new value in the new course. * * @return array */ public static function get_objectid_mapping() { return ['db' => 'h5pactivity', 'restore' => 'h5pactivity']; } } answer_created.php 0000644 00000011635 15152034674 0010260 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_choice answer created event. * * @package mod_choice * @copyright 2016 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_choice\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_choice answer created event class. * * @property-read array $other { * Extra information about event. * * - int choiceid: id of choice. * - int optionid: id of the option. * } * * @package mod_choice * @since Moodle 3.2 * @copyright 2016 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class answer_created extends \core\event\base { /** * Creates an instance of the event from the records * * @param stdClass $choiceanswer record from 'choice_answers' table * @param stdClass $choice record from 'choice' table * @param stdClass $cm record from 'course_modules' table * @param stdClass $course * @return self */ public static function create_from_object($choiceanswer, $choice, $cm, $course) { global $USER; $eventdata = array(); $eventdata['objectid'] = $choiceanswer->id; $eventdata['context'] = \context_module::instance($cm->id); $eventdata['userid'] = $USER->id; $eventdata['courseid'] = $course->id; $eventdata['relateduserid'] = $choiceanswer->userid; $eventdata['other'] = array(); $eventdata['other']['choiceid'] = $choice->id; $eventdata['other']['optionid'] = $choiceanswer->optionid; $event = self::create($eventdata); $event->add_record_snapshot('course', $course); $event->add_record_snapshot('course_modules', $cm); $event->add_record_snapshot('choice', $choice); $event->add_record_snapshot('choice_answers', $choiceanswer); return $event; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has added the option with id '" . $this->other['optionid'] . "' for the user with id '$this->relateduserid' from the choice activity with course module id '$this->contextinstanceid'."; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventanswercreated', 'mod_choice'); } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/choice/view.php', array('id' => $this->contextinstanceid)); } /** * Init method. * * @return void */ protected function init() { $this->data['objecttable'] = 'choice_answers'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['choiceid'])) { throw new \coding_exception('The \'choiceid\' value must be set in other.'); } if (!isset($this->other['optionid'])) { throw new \coding_exception('The \'optionid\' value must be set in other.'); } } /** * This is used when restoring course logs where it is required that we * map the objectid to it's new value in the new course. * * @return string the name of the restore mapping the objectid links to */ public static function get_objectid_mapping() { return array('db' => 'choice_answers', 'restore' => 'answer'); } /** * This is used when restoring course logs where it is required that we * map the information in 'other' to it's new value in the new course. * * @return array an array of other values and their corresponding mapping */ public static function get_other_mapping() { $othermapped = array(); $othermapped['choiceid'] = array('db' => 'choice', 'restore' => 'choice'); $othermapped['optionid'] = array('db' => 'choice_options', 'restore' => 'choice_option'); return $othermapped; } } answer_deleted.php 0000644 00000010717 15152034674 0010257 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_choice answer deleted event. * * @package mod_choice * @copyright 2016 Stephen Bourget * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_choice\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_choice answer deleted event class. * * @property-read array $other { * Extra information about event. * * - int choiceid: id of choice. * - int optionid: id of the option. * } * * @package mod_choice * @since Moodle 3.1 * @copyright 2016 Stephen Bourget * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class answer_deleted extends \core\event\base { /** * Creates an instance of the event from the records * * @param stdClass $choiceanswer record from 'choice_answers' table * @param stdClass $choice record from 'choice' table * @param stdClass $cm record from 'course_modules' table * @param stdClass $course * @return self */ public static function create_from_object($choiceanswer, $choice, $cm, $course) { global $USER; $eventdata = array(); $eventdata['objectid'] = $choiceanswer->id; $eventdata['context'] = \context_module::instance($cm->id); $eventdata['userid'] = $USER->id; $eventdata['courseid'] = $course->id; $eventdata['relateduserid'] = $choiceanswer->userid; $eventdata['other'] = array(); $eventdata['other']['choiceid'] = $choice->id; $eventdata['other']['optionid'] = $choiceanswer->optionid; $event = self::create($eventdata); $event->add_record_snapshot('course', $course); $event->add_record_snapshot('course_modules', $cm); $event->add_record_snapshot('choice', $choice); $event->add_record_snapshot('choice_answers', $choiceanswer); return $event; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has deleted the option with id '" . $this->other['optionid'] . "' for the user with id '$this->relateduserid' from the choice activity with course module id '$this->contextinstanceid'."; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventanswerdeleted', 'mod_choice'); } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/choice/view.php', array('id' => $this->contextinstanceid)); } /** * Init method. * * @return void */ protected function init() { $this->data['objecttable'] = 'choice_answers'; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['choiceid'])) { throw new \coding_exception('The \'choiceid\' value must be set in other.'); } if (!isset($this->other['optionid'])) { throw new \coding_exception('The \'optionid\' value must be set in other.'); } } public static function get_objectid_mapping() { return array('db' => 'choice_answers', 'restore' => \core\event\base::NOT_MAPPED); } public static function get_other_mapping() { $othermapped = array(); $othermapped['choiceid'] = array('db' => 'choice', 'restore' => 'choice'); $othermapped['optionid'] = array('db' => 'choice_options', 'restore' => 'choice_option'); return $othermapped; } } subscription_criteria_met.php 0000644 00000005015 15152157553 0012542 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The tool_monitor subscription criteria met event. * * @package tool_monitor * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_monitor\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_monitor subscription criteria met event class. * * @property-read array $other { * Extra information about event. * * - string subscriptionid: id of the subscription. * } * * @package tool_monitor * @since Moodle 2.8 * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class subscription_criteria_met extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_TEACHING; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventsubcriteriamet', 'tool_monitor'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The criteria for the subscription with id '{$this->other['subscriptionid']}' was met."; } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['subscriptionid'])) { throw new \coding_exception('The \'subscriptionid\' value must be set in other.'); } } public static function get_other_mapping() { // No mapping required for this event because event monitor subscriptions are not backed up. return false; } } rule_created.php 0000644 00000004616 15152157553 0007733 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The tool_monitor rule created event. * * @package tool_monitor * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_monitor\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_monitor rule created event class. * * @package tool_monitor * @since Moodle 2.8 * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class rule_created extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['objecttable'] = 'tool_monitor_rules'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventrulecreated', 'tool_monitor'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' created the event monitor rule with id '$this->objectid'."; } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/admin/tool/monitor/edit.php', array('ruleid' => $this->objectid, 'courseid' => $this->courseid)); } public static function get_objectid_mapping() { // No mapping required for this event because event monitor rules are not backed up. return array('db' => 'tool_monitor_rules', 'restore' => \core\event\base::NOT_MAPPED); } } subscription_deleted.php 0000644 00000004273 15152157553 0011506 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The tool_monitor subscription deleted event. * * @package tool_monitor * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_monitor\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_monitor subscription deleted event class. * * @package tool_monitor * @since Moodle 2.8 * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class subscription_deleted extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['objecttable'] = 'tool_monitor_subscriptions'; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_TEACHING; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventsubdeleted', 'tool_monitor'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' deleted the event monitor subscription with id '$this->objectid'."; } public static function get_objectid_mapping() { // No mapping required for this event because event monitor subscriptions are not backed up. return array('db' => 'tool_monitor_subscriptions', 'restore' => \core\event\base::NOT_MAPPED); } } subscription_created.php 0000644 00000004273 15152157553 0011507 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The tool_monitor subscription created event. * * @package tool_monitor * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_monitor\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_monitor subscription created event class. * * @package tool_monitor * @since Moodle 2.8 * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class subscription_created extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['objecttable'] = 'tool_monitor_subscriptions'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_TEACHING; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventsubcreated', 'tool_monitor'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' created the event monitor subscription with id '$this->objectid'."; } public static function get_objectid_mapping() { // No mapping required for this event because event monitor subscriptions are not backed up. return array('db' => 'tool_monitor_subscriptions', 'restore' => \core\event\base::NOT_MAPPED); } } rule_deleted.php 0000644 00000004554 15152157553 0007733 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The tool_monitor rule deleted event. * * @package tool_monitor * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_monitor\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_monitor rule deleted event class. * * @package tool_monitor * @since Moodle 2.8 * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class rule_deleted extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['objecttable'] = 'tool_monitor_rules'; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventruledeleted', 'tool_monitor'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' deleted the event monitor rule with id '$this->objectid'."; } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/admin/tool/monitor/managerules.php', array('courseid' => $this->courseid)); } public static function get_objectid_mapping() { // No mapping required for this event because event monitor rules are not backed up. return array('db' => 'tool_monitor_rules', 'restore' => \core\event\base::NOT_MAPPED); } } rule_updated.php 0000644 00000004616 15152157553 0007752 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The tool_monitor rule updated event. * * @package tool_monitor * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_monitor\event; defined('MOODLE_INTERNAL') || die(); /** * The tool_monitor rule updated event class. * * @package tool_monitor * @since Moodle 2.8 * @copyright 2014 Mark Nelson <markn@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class rule_updated extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['objecttable'] = 'tool_monitor_rules'; $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventruleupdated', 'tool_monitor'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' updated the event monitor rule with id '$this->objectid'."; } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/admin/tool/monitor/edit.php', array('ruleid' => $this->objectid, 'courseid' => $this->courseid)); } public static function get_objectid_mapping() { // No mapping required for this event because event monitor rules are not backed up. return array('db' => 'tool_monitor_rules', 'restore' => \core\event\base::NOT_MAPPED); } } field_updated.php 0000644 00000005172 15152217550 0010056 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Custom field updated event. * * @package core_customfield * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_customfield\event; use core_customfield\field_controller; defined('MOODLE_INTERNAL') || die(); /** * Custom field updated event class. * * @package core_customfield * @since Moodle 3.6 * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class field_updated extends \core\event\base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = 'customfield_field'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a field controller object * * @param field_controller $field * @return field_updated */ public static function create_from_object(field_controller $field) : field_updated { $eventparams = [ 'objectid' => $field->get('id'), 'context' => $field->get_handler()->get_configuration_context(), 'other' => [ 'shortname' => $field->get('shortname'), 'name' => $field->get('name') ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $field->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventfieldupdated', 'core_customfield'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' updated the field with id '$this->objectid'."; } } field_deleted.php 0000644 00000005152 15152217550 0010034 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Custom field updated event. * * @package core_customfield * @copyright 2018 Toni Barbera <toni@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_customfield\event; use core_customfield\field_controller; defined('MOODLE_INTERNAL') || die(); /** * Custom field updated event class. * * @package core_customfield * @since Moodle 3.6 * @copyright 2018 Toni Barbera <toni@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class field_deleted extends \core\event\base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = 'customfield_field'; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a field controller object * * @param field_controller $field * @return field_deleted */ public static function create_from_object(field_controller $field) : field_deleted { $eventparams = [ 'objectid' => $field->get('id'), 'context' => $field->get_handler()->get_configuration_context(), 'other' => [ 'shortname' => $field->get('shortname'), 'name' => $field->get('name') ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $field->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventfielddeleted', 'core_customfield'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' deleted the field with id '$this->objectid'."; } } category_updated.php 0000644 00000005140 15152217550 0010603 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Custom field category updated event. * * @package core_customfield * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_customfield\event; use core_customfield\category_controller; defined('MOODLE_INTERNAL') || die(); /** * Custom field category updated event class. * * @package core_customfield * @since Moodle 3.6 * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class category_updated extends \core\event\base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = 'customfield_category'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a category controller object * * @param category_controller $category * @return category_updated */ public static function create_from_object(category_controller $category) : category_updated { $eventparams = [ 'objectid' => $category->get('id'), 'context' => $category->get_handler()->get_configuration_context(), 'other' => ['name' => $category->get('name')] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $category->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventcategoryupdated', 'core_customfield'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' updated the category with id '$this->objectid'."; } } field_created.php 0000644 00000005172 15152217550 0010037 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Custom field created event. * * @package core_customfield * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_customfield\event; use core_customfield\field_controller; defined('MOODLE_INTERNAL') || die(); /** * Custom field created event class. * * @package core_customfield * @since Moodle 3.6 * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class field_created extends \core\event\base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = 'customfield_field'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a field controller object * * @param field_controller $field * @return field_created */ public static function create_from_object(field_controller $field) : field_created { $eventparams = [ 'objectid' => $field->get('id'), 'context' => $field->get_handler()->get_configuration_context(), 'other' => [ 'shortname' => $field->get('shortname'), 'name' => $field->get('name') ] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $field->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventfieldcreated', 'core_customfield'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' created the field with id '$this->objectid'."; } } category_deleted.php 0000644 00000005120 15152217550 0010561 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Custom field category created event. * * @package core_customfield * @copyright 2018 Toni Barbera <toni@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_customfield\event; use core_customfield\category_controller; defined('MOODLE_INTERNAL') || die(); /** * Custom field category created event class. * * @package core_customfield * @since Moodle 3.6 * @copyright 2018 Toni Barbera <toni@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class category_deleted extends \core\event\base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = 'customfield_category'; $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a category controller object * * @param category_controller $category * @return category_deleted */ public static function create_from_object(category_controller $category) : category_deleted { $eventparams = [ 'objectid' => $category->get('id'), 'context' => $category->get_handler()->get_configuration_context(), 'other' => ['name' => $category->get('name')] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $category->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventcategorydeleted', 'core_customfield'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' deleted the category with id '$this->objectid'."; } } category_created.php 0000644 00000005140 15152217550 0010564 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Custom field category created event. * * @package core_customfield * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_customfield\event; use core_customfield\category_controller; defined('MOODLE_INTERNAL') || die(); /** * Custom field category created event class. * * @package core_customfield * @since Moodle 3.6 * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class category_created extends \core\event\base { /** * Initialise the event data. */ protected function init() { $this->data['objecttable'] = 'customfield_category'; $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Creates an instance from a category controller object * * @param category_controller $category * @return category_created */ public static function create_from_object(category_controller $category) : category_created { $eventparams = [ 'objectid' => $category->get('id'), 'context' => $category->get_handler()->get_configuration_context(), 'other' => ['name' => $category->get('name')] ]; $event = self::create($eventparams); $event->add_record_snapshot($event->objecttable, $category->to_record()); return $event; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventcategorycreated', 'core_customfield'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' created the category with id '$this->objectid'."; } } submission_deleted.php 0000644 00000006375 15152220202 0011140 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop submission deleted event. * * @package mod_workshop * @copyright 2015 Paul Nicholls * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop submission deleted event class. * * @property-read array $other { * Extra information about the event. * * - string submissiontitle: (optional) Submission title. * } * * @package mod_workshop * @since Moodle 3.1 * @copyright 2015 Paul Nicholls * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class submission_deleted extends \core\event\base { /** * Init method. */ protected function init() { $this->data['crud'] = 'd'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'workshop_submissions'; } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' deleted the submission with id '$this->objectid' for the workshop " . "with course module id '$this->contextinstanceid'."; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventsubmissiondeleted', 'workshop'); } /** * Returns relevant URL. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/submission.php', array('cmid' => $this->contextinstanceid, 'id' => $this->objectid)); } /** * Replace add_to_log() statement. * * @return array of parameters to be passed to legacy add_to_log() function. */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'delete submission', 'submission.php?cmid=' . $this->contextinstanceid . '&id=' . $this->objectid, $this->objectid, $this->contextinstanceid); } /** * Defines mapping of the 'objectid' property when restoring course logs. * * @return array */ public static function get_objectid_mapping() { return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission'); } /** * Defines mapping of the 'other' property when restoring course logs. * * @return array|bool */ public static function get_other_mapping() { // Nothing to map. return false; } } assessments_reset.php 0000644 00000006153 15152220202 0011023 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop submission assessments reset event. * * @package mod_workshop * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop submission assessments reset event class. * * @property-read array $other { * Extra information about the event. * * - int workshopid: the ID of the workshop. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class assessments_reset extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_TEACHING; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has reset the assessments for the workshop with course module id " . "'$this->contextinstanceid'."; } /** * Return the legacy event log data. * * @return array|null */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'update clear assessments', 'view.php?id=' . $this->contextinstanceid, $this->other['workshopid'], $this->contextinstanceid); } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventsubmissionassessmentsreset', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid)); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['workshopid'])) { throw new \coding_exception('The \'workshopid\' value must be set in other.'); } } public static function get_other_mapping() { $othermapped = array(); $othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop'); return $othermapped; } } phase_automatically_switched.php 0000644 00000006441 15152220202 0013173 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. namespace mod_workshop\event; /** * This event is triggered when a phase is automatically switched, usually from cron_task. * * @property-read array $other { * Extra information about the event. * * - int previousworkshopphase: Previous workshop phase. * - int targetworkshopphase: Target workshop phase. * } * * @package mod_workshop * @copyright 2020 Universitat Jaume I <https://www.uji.es/> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class phase_automatically_switched extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_TEACHING; $this->data['objecttable'] = 'workshop'; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The phase of the workshop with course module id " . "'$this->contextinstanceid' has been automatically switched from " . "'{$this->other['previousworkshopphase']} to '{$this->other['currentworkshopphase']}'."; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventphaseautomaticallyswitched', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid)); } /** * Custom validation. * * @return void * @throws \coding_exception */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['previousworkshopphase'])) { throw new \coding_exception('The \'previousworkshopphase\' value must be set in other.'); } if (!isset($this->other['targetworkshopphase'])) { throw new \coding_exception('The \'targetworkshopphase\' value must be set in other.'); } } /** * Map the objectid information in order to restore the event accurately. In this event * objectid is the workshop id. * * @return array */ public static function get_objectid_mapping() { return array('db' => 'workshop', 'restore' => 'workshop'); } /** * No need to map the 'other' field as it only stores phases and they don't need to be mapped. * * @return bool */ public static function get_other_mapping() { return false; } } assessment_evaluated.php 0000644 00000005205 15152220202 0011465 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop assessment evaluated event. * * @package mod_workshop * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop assessment evaluated event class. * * @property-read array $other { * Extra information about the event. * * - string currentgrade: (may be null) current saved grade. * - string finalgrade: (may be null) final grade. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class assessment_evaluated extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_TEACHING; $this->data['objecttable'] = 'workshop_aggregations'; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has had their assessment attempt evaluated for the workshop with " . "course module id '$this->contextinstanceid'."; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventassessmentevaluated', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid)); } public static function get_objectid_mapping() { return array('db' => 'workshop_aggregations', 'restore' => 'workshop_aggregation'); } public static function get_other_mapping() { // Nothing to map. return false; } } phase_switched.php 0000644 00000006254 15152220202 0010245 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop phase switched event. * * @package mod_workshop * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop phase switched event class. * * @property-read array $other { * Extra information about the event. * * - int workshopphase: Workshop phase. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class phase_switched extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_TEACHING; $this->data['objecttable'] = 'workshop'; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has switched the phase of the workshop with course module id " . "'$this->contextinstanceid' to '{$this->other['workshopphase']}'."; } /** * Return the legacy event log data. * * @return array|null */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'update switch phase', 'view.php?id=' . $this->contextinstanceid, $this->other['workshopphase'], $this->contextinstanceid); } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventphaseswitched', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid)); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['workshopphase'])) { throw new \coding_exception('The \'workshopphase\' value must be set in other.'); } } public static function get_objectid_mapping() { return array('db' => 'workshop', 'restore' => 'workshop'); } public static function get_other_mapping() { // Nothing to map. return false; } } assessment_reevaluated.php 0000644 00000005717 15152220202 0012024 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop assessment_reevaluated event. * * @package mod_workshop * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop assessment_reevaluated event class. * * @property-read array $other { * Extra information about the event. * * - float currentgrade: (may be null) current saved grade. * - float finalgrade: (may be null) final grade. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class assessment_reevaluated extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_TEACHING; $this->data['objecttable'] = 'workshop_aggregations'; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has had their assessment attempt reevaluated for the workshop with " . "course module id '$this->contextinstanceid'."; } /** * Return the legacy event log data. * * @return array|null */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'update aggregate grade', 'view.php?id=' . $this->contextinstanceid, $this->objectid, $this->contextinstanceid); } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventassessmentreevaluated', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid)); } public static function get_objectid_mapping() { return array('db' => 'workshop_aggregations', 'restore' => 'workshop_aggregation'); } public static function get_other_mapping() { // Nothing to map. return false; } } submission_viewed.php 0000644 00000006643 15152220202 0011013 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop submission viewed event. * * @package mod_workshop * @copyright 2013 Adrian Greeve <adrian@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop submission viewed event class. * * @property-read array $other { * Extra information about the event. * * - int workshopid: (optional) workshop ID. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class submission_viewed extends \core\event\base { /** * Init method. */ protected function init() { $this->data['crud'] = 'r'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'workshop_submissions'; } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' viewed the submission with id '$this->objectid' for the workshop " . "with course module id '$this->contextinstanceid'."; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventsubmissionviewed', 'workshop'); } /** * Returns relevant URL. * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/submission.php', array('cmid' => $this->contextinstanceid, 'id' => $this->objectid)); } /** * replace add_to_log() statement. * * @return array of parameters to be passed to legacy add_to_log() function. */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'view submission', 'submission.php?cmid=' . $this->contextinstanceid . '&id=' . $this->objectid, $this->objectid, $this->contextinstanceid); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->relateduserid)) { throw new \coding_exception('The \'relateduserid\' must be set.'); } } public static function get_objectid_mapping() { return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission'); } public static function get_other_mapping() { $othermapped = array(); $othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop'); return $othermapped; } } submission_updated.php 0000644 00000006024 15152220202 0011147 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop submission updated event. * * @package mod_workshop * @copyright 2013 Adrian Greeve <adrian@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop submission updated event class. * * @property-read array $other { * Extra information about the event. * * - string submissiontitle: (optional) Submission title. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class submission_updated extends \core\event\base { /** * Init method. */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'workshop_submissions'; } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' updated the submission with id '$this->objectid' for the workshop " . "with course module id '$this->contextinstanceid'."; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventsubmissionupdated', 'workshop'); } /** * Returns relevant URL. * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/submission.php', array('cmid' => $this->contextinstanceid, 'id' => $this->objectid)); } /** * replace add_to_log() statement. * * @return array of parameters to be passed to legacy add_to_log() function. */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'update submission', 'submission.php?cmid=' . $this->contextinstanceid . '&id=' . $this->objectid, $this->objectid, $this->contextinstanceid); } public static function get_objectid_mapping() { return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission'); } public static function get_other_mapping() { // Nothing to map. return false; } } submission_created.php 0000644 00000006024 15152220202 0011130 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop submission created event. * * @package mod_workshop * @copyright 2013 Adrian Greeve <adrian@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop submission created event class. * * @property-read array $other { * Extra information about the event. * * - string submissiontitle: (optional) Submission title. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class submission_created extends \core\event\base { /** * Init method. */ protected function init() { $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'workshop_submissions'; } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' created the submission with id of '$this->objectid' for the workshop " . "with course module id '$this->contextinstanceid'."; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('eventsubmissioncreated', 'workshop'); } /** * Returns relevant URL. * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/submission.php', array('cmid' => $this->contextinstanceid, 'id' => $this->objectid)); } /** * replace add_to_log() statement. * * @return array of parameters to be passed to legacy add_to_log() function. */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'add submission', 'submission.php?cmid=' . $this->contextinstanceid . '&id=' . $this->objectid, $this->objectid, $this->contextinstanceid); } public static function get_objectid_mapping() { return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission'); } public static function get_other_mapping() { // Nothing to map. return false; } } submission_reassessed.php 0000644 00000007314 15152220202 0011665 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop submission reassessed event. * * @package mod_workshop * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop submission reassessed event class. * * @property-read array $other { * Extra information about the event. * * - int submissionid: Submission ID. * - int workshopid: (optional) Workshop ID. * - float grade: (optional) Assessment grade. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class submission_reassessed extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'workshop_assessments'; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' reassessed the submission with id '$this->objectid' for the user with " . "id '$this->relateduserid' in the workshop with course module id '$this->contextinstanceid'."; } /** * Return the legacy event log data. * * @return array|null */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'update assessment', 'assessment.php?asid=' . $this->objectid, $this->other['submissionid'], $this->contextinstanceid); } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventsubmissionreassessed', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/assessment.php?', array('asid' => $this->objectid)); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->relateduserid)) { throw new \coding_exception('The \'relateduserid\' must be set.'); } if (!isset($this->other['submissionid'])) { throw new \coding_exception('The \'submissionid\' value must be set in other.'); } } public static function get_objectid_mapping() { return array('db' => 'workshop_assessments', 'restore' => 'workshop_assessment'); } public static function get_other_mapping() { $othermapped = array(); $othermapped['submissionid'] = array('db' => 'workshop_submissions', 'restore' => 'workshop_submission'); $othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop'); return $othermapped; } } assessment_evaluations_reset.php 0000644 00000006237 15152220202 0013255 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop assessment_evaluations reset event. * * @package mod_workshop * @category event * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop assessment_evaluations reset event class. * * @property-read array $other { * Extra information about the event. * * - int workshopid: the ID of the workshop. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class assessment_evaluations_reset extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_TEACHING; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has reset the assessment evaluations for the workshop with course module id " . "'$this->contextinstanceid'."; } /** * Return the legacy event log data. * * @return array|null */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'update clear aggregated grade', 'view.php?id=' . $this->contextinstanceid, $this->other['workshopid'], $this->contextinstanceid); } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventassessmentevaluationsreset', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid)); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->other['workshopid'])) { throw new \coding_exception('The \'workshopid\' value must be set in other.'); } } public static function get_other_mapping() { $othermapped = array(); $othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop'); return $othermapped; } } assessable_uploaded.php 0000644 00000007257 15152220202 0011261 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop assessable uploaded event. * * @package mod_workshop * @copyright 2013 Frédéric Massart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop assessable uploaded event class. * * @package mod_workshop * @since Moodle 2.6 * @copyright 2013 Frédéric Massart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class assessable_uploaded extends \core\event\assessable_uploaded { /** * Legacy log data. * * @var array */ protected $legacylogdata = null; /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' has uploaded the submission with id '$this->objectid' " . "to the workshop activity with course module id '$this->contextinstanceid'."; } /** * Legacy event data if get_legacy_eventname() is not empty. * * @return \stdClass */ protected function get_legacy_eventdata() { $eventdata = new \stdClass(); $eventdata->modulename = 'workshop'; $eventdata->cmid = $this->contextinstanceid; $eventdata->itemid = $this->objectid; $eventdata->courseid = $this->courseid; $eventdata->userid = $this->userid; $eventdata->content = $this->other['content']; if ($this->other['pathnamehashes']) { $eventdata->pathnamehashes = $this->other['pathnamehashes']; } return $eventdata; } /** * Return the legacy event name. * * @return string */ public static function get_legacy_eventname() { return 'assessable_content_uploaded'; } /** * Return the legacy log data. * * @return array */ protected function get_legacy_logdata() { return $this->legacylogdata; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventassessableuploaded', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/submission.php', array('cmid' => $this->contextinstanceid, 'id' => $this->objectid)); } /** * Init method. * * @return void */ protected function init() { parent::init(); $this->data['objecttable'] = 'workshop_submissions'; } /** * Set the legacy log data. * * @param array $legacylogdata * @return void */ public function set_legacy_logdata($legacylogdata) { $this->legacylogdata = $legacylogdata; } public static function get_objectid_mapping() { return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission'); } } submission_assessed.php 0000644 00000007213 15152220202 0011334 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The mod_workshop submission assessed event. * * @package mod_workshop * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_workshop\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_workshop submission assessed event class. * * @property-read array $other { * Extra information about the event. * * - int submissionid: Submission ID. * - int workshopid: (optional) Workshop ID. * } * * @package mod_workshop * @since Moodle 2.7 * @copyright 2013 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class submission_assessed extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'c'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'workshop_assessments'; } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' assessed the submission with id '$this->objectid' for the user with " . "id '$this->relateduserid' in the workshop with course module id '$this->contextinstanceid'."; } /** * Return the legacy event log data. * * @return array|null */ protected function get_legacy_logdata() { return array($this->courseid, 'workshop', 'add assessment ', 'assessment.php?asid=' . $this->objectid, $this->other['submissionid'], $this->contextinstanceid); } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventsubmissionassessed', 'mod_workshop'); } /** * Get URL related to the action. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/workshop/assessment.php', array('asid' => $this->objectid)); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (!isset($this->relateduserid)) { throw new \coding_exception('The \'relateduserid\' must be set.'); } if (!isset($this->other['submissionid'])) { throw new \coding_exception('The \'submissionid\' value must be set in other.'); } } public static function get_objectid_mapping() { return array('db' => 'workshop_assessments', 'restore' => 'workshop_assessment'); } public static function get_other_mapping() { $othermapped = array(); $othermapped['submissionid'] = array('db' => 'workshop_submissions', 'restore' => 'workshop_submission'); $othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop'); return $othermapped; } } statement_received.php 0000644 00000005052 15152233615 0011134 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * H5P activity send an xAPI tracking statement. * * @package mod_h5pactivity * @copyright 2020 Ferran Recio <ferran@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\event; defined('MOODLE_INTERNAL') || die(); /** * The statement_received event class. * * @package mod_h5pactivity * @copyright 2020 Ferran Recio <ferran@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class statement_received extends \core\event\base { /** * Init method. * * @return void */ protected function init(): void { $this->data['objecttable'] = 'h5pactivity'; $this->data['crud'] = 'u'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; } /** * Returns localised general event name. * * @return string */ public static function get_name() { return get_string('statement_received', 'mod_h5pactivity'); } /** * Returns non-localised description of what happened. * * @return string */ public function get_description() { return "The user with the id '$this->userid' send a tracking statement " . "for a H5P activity with the course module id '$this->contextinstanceid'."; } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/h5pactivity/grade.php', ['id' => $this->contextinstanceid, 'user' => $this->userid]); } /** * This is used when restoring course logs where it is required that we * map the objectid to it's new value in the new course. * * @return array */ public static function get_objectid_mapping() { return ['db' => 'h5pactivity', 'restore' => 'h5pactivity']; } } comment_deleted.php 0000644 00000002430 15152302443 0010403 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * block_comments comment deleted event. * * @package block_comments * @copyright 2013 Rajesh Taneja <rajesh@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace block_comments\event; defined('MOODLE_INTERNAL') || die(); /** * block_comments comment deleted event. * * @package block_comments * @since Moodle 2.7 * @copyright 2013 Rajesh Taneja <rajesh@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class comment_deleted extends \core\event\comment_deleted { // No need to override any method. } comment_created.php 0000644 00000002430 15152302443 0010404 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * block_comments comment created event. * * @package block_comments * @copyright 2013 Rajesh Taneja <rajesh@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace block_comments\event; defined('MOODLE_INTERNAL') || die(); /** * block_comments comment created event. * * @package block_comments * @since Moodle 2.7 * @copyright 2013 Rajesh Taneja <rajesh@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class comment_created extends \core\event\comment_created { // No need to override any method. } user_report_viewed.php 0000644 00000006162 15152537447 0011213 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * The report_log user report viewed event. * * @package report_log * @copyright 2013 Ankit Agarwal * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace report_log\event; defined('MOODLE_INTERNAL') || die(); /** * The report_log user report viewed event class. * * @property-read array $other { * Extra information about the event. * * - string mode: display mode. * } * * @package report_log * @since Moodle 2.7 * @copyright 2013 Ankit Agarwal * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class user_report_viewed extends \core\event\base { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'r'; $this->data['edulevel'] = self::LEVEL_OTHER; } /** * Return localised event name. * * @return string */ public static function get_name() { return get_string('eventuserreportviewed', 'report_log'); } /** * Returns description of what happened. * * @return string */ public function get_description() { return "The user with id '$this->userid' viewed the user log report for the user with id '$this->relateduserid'."; } /** * Return the legacy event log data. * * @return array */ protected function get_legacy_logdata() { $url = 'report/log/user.php?id=' . $this->relateduserid . '&course=' . $this->courseid . '&mode=' . $this->other['mode']; return array($this->courseid, 'course', 'report log', $url, $this->courseid); } /** * Returns relevant URL. * * @return \moodle_url */ public function get_url() { return new \moodle_url('/report/log/user.php', array('course' => $this->courseid, 'id' => $this->relateduserid, 'mode' => $this->other['mode'])); } /** * Custom validation. * * @throws \coding_exception * @return void */ protected function validate_data() { parent::validate_data(); if (empty($this->other['mode'])) { throw new \coding_exception('The \'mode\' value must be set in other.'); } if (empty($this->relateduserid)) { throw new \coding_exception('The \'relateduserid\' must be set.'); } } public static function get_other_mapping() { // Nothing to map. return false; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�