first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,110 @@
<?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_quiz attempt abandoned event.
*
* @package mod_quiz
* @copyright 2013 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt abandoned event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int submitterid: id of submitter (null when trigged by CLI script).
* - int quizid: (optional) id of the quiz.
* }
*
* @package mod_quiz
* @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 attempt_abandoned extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->relateduserid' has had their attempt with id '$this->objectid' marked as abandoned " .
"for the quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventquizattemptabandoned', 'mod_quiz');
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', ['attempt' => $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 (!array_key_exists('submitterid', $this->other)) {
throw new \coding_exception('The \'submitterid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['submitterid'] = ['db' => 'user', 'restore' => 'user'];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,131 @@
<?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_quiz attempt auto-saved event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz attempt auto-saved event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int page: the page number of attempt.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_autosaved extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$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('eventattemptautosaved', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
$pagenumber = $this->other['page'] + 1;
return "The user with id '$this->userid' is working on page " .
"'{$pagenumber}' of the attempt " .
"with id '$this->objectid' for the quiz with course module id '$this->contextinstanceid', " .
"and their latest responses have been saved automatically.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', [
'attempt' => $this->objectid,
'page' => $this->other['page']
]);
}
/**
* 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['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['page'])) {
throw new \coding_exception('The \'page\' value must be set in other.');
}
}
/**
* 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 List of mapping of other ids.
*/
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
/**
* 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 List of mapping of other ids.
*/
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,113 @@
<?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_quiz attempt became overdue event.
*
* @package mod_quiz
* @copyright 2013 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt became overdue event class.
*
* Please note that the name of this event is not following the event naming convention.
* Its name should not be used as a reference for other events to be created.
*
* @property-read array $other {
* Extra information about event.
*
* - int submitterid: id of submitter (null when trigged by CLI script).
* - int quizid: (optional) the id of the quiz.
* }
*
* @package mod_quiz
* @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 attempt_becameoverdue extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The quiz attempt with id '$this->objectid' belonging to the quiz with course module id '$this->contextinstanceid' " .
"for the user with id '$this->relateduserid' became overdue.";
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventquizattempttimelimitexceeded', 'mod_quiz');
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', ['attempt' => $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 (!array_key_exists('submitterid', $this->other)) {
throw new \coding_exception('The \'submitterid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['submitterid'] = ['db' => 'user', 'restore' => 'user'];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
+109
View File
@@ -0,0 +1,109 @@
<?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_quiz attempt deleted event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_deleted extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventattemptdeleted', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' deleted the attempt with id '$this->objectid' belonging to the quiz " .
"with course module id '$this->contextinstanceid' for the user with id '$this->relateduserid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/report.php', ['id' => $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.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,69 @@
<?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_quiz\event;
/**
* The mod_quiz attempt manual grading complete event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_manual_grading_completed extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public function get_description() {
return "The attempt with id '$this->objectid' for the user with id '$this->relateduserid' " .
"for the quiz with course module id '$this->contextinstanceid' is now fully graded. Sending notification.";
}
public static function get_name() {
return get_string('eventattemptmanualgradingcomplete', 'mod_quiz');
}
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', ['attempt' => $this->objectid]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,110 @@
<?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_quiz attempt preview started event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt preview started event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_preview_started extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventattemptpreviewstarted', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->relateduserid' has had their attempt with id '$this->objectid' previewed by " .
"the user with id '$this->userid' for the quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/view.php', ['id' => $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.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,140 @@
<?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_quiz attempt question restarted event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz attempt question restarted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int page: the page number of attempt.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_question_restarted extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$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('eventattemptquestionrestarted', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
$pagenumber = $this->other['page'] + 1;
return "The user with id '$this->userid' has restarted question at slot '{$this->other['slot']}' on page " .
"'{$pagenumber}' of the attempt with id '$this->objectid' belonging to the user " .
"with id '$this->relateduserid' for the quiz with course module id '$this->contextinstanceid', " .
"and the new question id is '{$this->other['newquestionid']}'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', [
'attempt' => $this->objectid,
'page' => $this->other['page']
]);
}
/**
* 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['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['page'])) {
throw new \coding_exception('The \'page\' value must be set in other.');
}
if (!isset($this->other['slot'])) {
throw new \coding_exception('The \'slot\' value must be set in other.');
}
if (!isset($this->other['newquestionid'])) {
throw new \coding_exception('The \'newquestionid\' value must be set in other.');
}
}
/**
* 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 List of mapping of other ids.
*/
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
/**
* 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 List of mapping of other ids.
*/
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['newquestionid'] = ['db' => 'question', 'restore' => 'question'];
return $othermapped;
}
}
+122
View File
@@ -0,0 +1,122 @@
<?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_quiz attempt regraded event.
*
* @package mod_quiz
* @copyright 2020 Russell Boyatt <russell.boyatt@warwick.ac.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt regraded event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @copyright 2020 Russell Boyatt <russell.boyatt@warwick.ac.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_regraded extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventquizattemptregraded', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' regraded quiz attempt with id '$this->objectid' by user " .
"with id '$this->relateduserid' for the quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', ['attempt' => $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->userid)) {
throw new \coding_exception('The \'userid\' must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
/**
* Get mapping to objects
*
* @return array Array of mappings
*/
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
/**
* Retrieve other mapping detail for the event.
*
* @return array Array of array mappings
*/
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,81 @@
<?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_quiz\event;
use coding_exception;
use core\event\base;
use moodle_url;
/**
* Event fired when a quiz attempt is reopened.
*
* @property-read array $other {
* Extra information about event.
*
* - int submitterid: id of submitter (null when triggered by CLI script).
* - int quizid: (optional) id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 4.2
* @copyright 2023 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_reopened extends base {
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public function get_description(): string {
return "The user with id '$this->relateduserid' has had their attempt with id '$this->objectid'" .
"for the quiz with course module id '$this->contextinstanceid' re-opened by the user with id '$this->userid'.";
}
public static function get_name(): string {
return get_string('eventquizattemptreopened', 'mod_quiz');
}
public function get_url(): moodle_url {
return new moodle_url('/mod/quiz/review.php', ['attempt' => $this->objectid]);
}
protected function validate_data(): void {
parent::validate_data();
if (!isset($this->relateduserid)) {
throw new coding_exception('The \'relateduserid\' must be set.');
}
if (!array_key_exists('submitterid', $this->other)) {
throw new coding_exception('The \'submitterid\' value must be set in other.');
}
}
public static function get_objectid_mapping(): array {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping(): array {
return [
'submitterid' => ['db' => 'user', 'restore' => 'user'],
'quizid' => ['db' => 'quiz', 'restore' => 'quiz'],
];
}
}
+109
View File
@@ -0,0 +1,109 @@
<?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_quiz attempt reviewed event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt reviewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_reviewed extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventattemptreviewed', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' has reviewed quiz attempt with id '$this->objectid' by user ".
"with id '$this->relateduserid' for the quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', ['attempt' => $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['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
+103
View File
@@ -0,0 +1,103 @@
<?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_quiz attempt started event.
*
* @package mod_quiz
* @copyright 2013 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt started event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: (optional) the id of the quiz.
* }
*
* @package mod_quiz
* @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 attempt_started extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->relateduserid' has started the attempt with id '$this->objectid' for the " .
"quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventquizattemptstarted', 'mod_quiz');
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', ['attempt' => $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.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,111 @@
<?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_quiz attempt submitted event.
*
* @package mod_quiz
* @copyright 2013 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt submitted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int submitterid: id of submitter (null when trigged by CLI script).
* - int quizid: (optional) the id of the quiz.
* - bool studentisonline: is the student currently interacting with Moodle?
* }
*
* @package mod_quiz
* @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 attempt_submitted extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->relateduserid' has submitted the attempt with id '$this->objectid' for the " .
"quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventquizattemptsubmitted', 'mod_quiz');
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', ['attempt' => $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 (!array_key_exists('submitterid', $this->other)) {
throw new \coding_exception('The \'submitterid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['submitterid'] = ['db' => 'user', 'restore' => 'user'];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,112 @@
<?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_quiz attempt summary viewed event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt summary viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_summary_viewed extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventattemptsummaryviewed', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' has viewed the summary for the attempt with id '$this->objectid' belonging " .
"to the user with id '$this->relateduserid' for the quiz with course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/summary.php', ['attempt' => $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['quizid'])) {
throw new \coding_exception('The \'quizid\' must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
+130
View File
@@ -0,0 +1,130 @@
<?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_quiz attempt updated event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz attempt updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int page: the page number of attempt.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_updated extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$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('eventattemptupdated', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
$pagenumber = $this->other['page'] + 1;
return "The user with id '$this->userid' has updated responses on page '{$pagenumber}' of the attempt " .
"with id '$this->objectid' belonging to the user " .
"with id '$this->relateduserid' for the quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', [
'attempt' => $this->objectid,
'page' => $this->other['page']
]);
}
/**
* 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['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['page'])) {
throw new \coding_exception('The \'page\' 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 array Mapping of object id.
*/
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
/**
* 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 List of mapping of other ids.
*/
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
+120
View File
@@ -0,0 +1,120 @@
<?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_quiz attempt viewed event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz attempt viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int page: the page number of attempt.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class attempt_viewed extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_attempts';
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventattemptviewed', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
$page = isset($this->other['page']) ? $this->other['page'] + 1 : '';
return "The user with id '$this->userid' has viewed page '$page' of the attempt with id " .
"'$this->objectid' belonging to the user with id '$this->relateduserid' for the quiz " .
"with course module id '$this->contextinstanceid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/review.php', [
'attempt' => $this->objectid,
'page' => isset($this->other['page']) ? $this->other['page'] : 0
]);
}
/**
* 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['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['page'])) {
throw new \coding_exception('The \'page\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,39 @@
<?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_quiz instance list viewed event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz instance list viewed event class.
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@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 {
// No code required here as the parent class handles it all.
}
@@ -0,0 +1,53 @@
<?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_quiz course module viewed event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz course module viewed event class.
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@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() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'quiz';
}
public static function get_objectid_mapping() {
return ['db' => 'quiz', 'restore' => 'quiz'];
}
}
+101
View File
@@ -0,0 +1,101 @@
<?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_quiz edit page viewed event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz edit page viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class edit_page_viewed 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('eventeditpageviewed', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the edit page for the quiz with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', ['cmid' => $this->contextinstanceid]);
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,112 @@
<?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_quiz group override created event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz group override created event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int groupid: the id of the group.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class group_override_created extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_overrides';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventoverridecreated', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' created the override with id '$this->objectid' for the quiz with " .
"course module id '$this->contextinstanceid' for the group with id '{$this->other['groupid']}'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/overrideedit.php', ['id' => $this->objectid]);
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['groupid'])) {
throw new \coding_exception('The \'groupid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_overrides', 'restore' => 'quiz_override'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['groupid'] = ['db' => 'groups', 'restore' => 'group'];
return $othermapped;
}
}
@@ -0,0 +1,111 @@
<?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_quiz group override deleted event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz group override deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int groupid: the id of the group.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class group_override_deleted extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_overrides';
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventoverridedeleted', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' deleted the override with id '$this->objectid' for the quiz with " .
"course module id '$this->contextinstanceid' for the group with id '{$this->other['groupid']}'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/overrides.php', ['cmid' => $this->contextinstanceid]);
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['groupid'])) {
throw new \coding_exception('The \'groupid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_overrides', 'restore' => 'quiz_override'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['groupid'] = ['db' => 'groups', 'restore' => 'group'];
return $othermapped;
}
}
@@ -0,0 +1,111 @@
<?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_quiz group override updated event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz group override updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int groupid: the id of the group.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class group_override_updated extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_overrides';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventoverrideupdated', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' updated the override with id '$this->objectid' for the quiz with " .
"course module id '$this->contextinstanceid' for the group with id '{$this->other['groupid']}'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/overrideedit.php', ['id' => $this->objectid]);
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['groupid'])) {
throw new \coding_exception('The \'groupid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_overrides', 'restore' => 'quiz_override'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['groupid'] = ['db' => 'groups', 'restore' => 'group'];
return $othermapped;
}
}
@@ -0,0 +1,94 @@
<?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_quiz page break created event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz page break created event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int slotnumber: the slot number which we will add the page break before.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_break_created extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventpagebreakcreated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' created the page break before the slot with id '{$this->objectid}' " .
"and slot number '{$this->other['slotnumber']}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['slotnumber'])) {
throw new \coding_exception('The \'slotnumber\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,94 @@
<?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_quiz page break deleted event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz page break deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int slotnumber: the slot number which we will remove the page break before.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_break_deleted extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventpagebreakdeleted', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' deleted the page break before the slot with id '{$this->objectid}' " .
"and slot number '{$this->other['slotnumber']}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['slotnumber'])) {
throw new \coding_exception('The \'slotnumber\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,117 @@
<?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_quiz question manually graded event.
*
* @package core
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz question manually graded event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int attemptid: the id of the attempt.
* - int slot: the question number in the attempt.
* }
*
* @package core
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_manually_graded extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'question';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventquestionmanuallygraded', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' manually graded the question with id '$this->objectid' for the attempt " .
"with id '{$this->other['attemptid']}' for the quiz with course module id '$this->contextinstanceid'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/comment.php', ['attempt' => $this->other['attemptid'],
'slot' => $this->other['slot']]);
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['attemptid'])) {
throw new \coding_exception('The \'attemptid\' value must be set in other.');
}
if (!isset($this->other['slot'])) {
throw new \coding_exception('The \'slot\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'question', 'restore' => 'question'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['attemptid'] = ['db' => 'quiz_attempts', 'restore' => 'quiz_attempt'];
return $othermapped;
}
}
@@ -0,0 +1,72 @@
<?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_quiz\event;
/**
* Event to record a quiz grade item being created.
*
* @property-read array $other {
* }
*
* @package mod_quiz
* @copyright 2023 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_grade_item_created extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_grade_items';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventquizgradeitemcreated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' created quiz grade item with id '$this->objectid' " .
"for the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/editgrading.php', [
'cmid' => $this->contextinstanceid,
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_grade_items', 'restore' => 'quiz_grade_items'];
}
public static function get_other_mapping() {
return [
'quizid' => ['db' => 'quiz', 'restore' => 'quiz'],
];
}
}
@@ -0,0 +1,72 @@
<?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_quiz\event;
/**
* Event to record a quiz grade item being deleted.
*
* @property-read array $other {
* }
*
* @package mod_quiz
* @copyright 2023 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_grade_item_deleted extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_grade_items';
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventquizgradeitemdeleted', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' deleted quiz grade item with id '$this->objectid' " .
"for the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/editgrading.php', [
'cmid' => $this->contextinstanceid,
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_grade_items', 'restore' => 'quiz_grade_items'];
}
public static function get_other_mapping() {
return [
'quizid' => ['db' => 'quiz', 'restore' => 'quiz'],
];
}
}
@@ -0,0 +1,72 @@
<?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_quiz\event;
/**
* Event to record a quiz grade item being updated.
*
* @property-read array $other {
* }
*
* @package mod_quiz
* @copyright 2023 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_grade_item_updated extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_grade_items';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventquizgradeitemupdated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' updated quiz grade item with id '$this->objectid' " .
"for the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/editgrading.php', [
'cmid' => $this->contextinstanceid,
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_grade_items', 'restore' => 'quiz_grade_items'];
}
public static function get_other_mapping() {
return [
'quizid' => ['db' => 'quiz', 'restore' => 'quiz'],
];
}
}
@@ -0,0 +1,66 @@
<?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_quiz\event;
/**
* Event to record a quiz grade item being re-ordered.
*
* @property-read array $other {
* }
*
* @package mod_quiz
* @copyright 2023 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_grade_items_reordered extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventquizgradeitemorderchanged', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' re-ordered the grade items " .
"for the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/editgrading.php', [
'cmid' => $this->contextinstanceid,
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz', 'restore' => 'quiz'];
}
public static function get_other_mapping() {
return [];
}
}
@@ -0,0 +1,91 @@
<?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_quiz quiz grade updated event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz quiz grade updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int newgrade: the new maximum grade value.
* - int oldgrade: the old maximum grade value.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_grade_updated extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventquizgradeupdated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' updated the maximum grade for the quiz with " .
"course module id '$this->contextinstanceid'. " .
"The maximum grade was changed from '{$this->other['oldgrade']}' to '{$this->other['newgrade']}'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid,
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['oldgrade'])) {
throw new \coding_exception('The \'oldgrade\' value must be set in other.');
}
if (!isset($this->other['newgrade'])) {
throw new \coding_exception('The \'newgrade\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz', 'restore' => 'quiz'];
}
public static function get_other_mapping() {
return [];
}
}
@@ -0,0 +1,85 @@
<?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_quiz quiz re-paginated event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz quiz re-paginated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int slotsperpage: the slot number per page option.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_repaginated extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventquizrepaginated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' re-paginated the quiz with course module id '$this->contextinstanceid' " .
" with the new option '{$this->other['slotsperpage']}' slot(s) per page.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['slotsperpage'])) {
throw new \coding_exception('The \'slotsperpage\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz', 'restore' => 'quiz'];
}
public static function get_other_mapping() {
return [];
}
}
+109
View File
@@ -0,0 +1,109 @@
<?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_quiz report viewed event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz report viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - string reportname: the name of the report.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @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_TEACHING;
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventreportviewed', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the report '" . s($this->other['reportname']) . "' for the quiz with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/report.php', ['id' => $this->contextinstanceid,
'mode' => $this->other['reportname']]);
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['reportname'])) {
throw new \coding_exception('The \'reportname\' value must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,106 @@
<?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_quiz section break created event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz section break created event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int firstslotid: id of the slot which we will add the section break before.
* - int firstslotnumber: slot number of the slot which we will add the section break before.
* - string title: the title of new section.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class section_break_created extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_sections';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventsectionbreakcreated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' created a new section break with id '{$this->objectid}' " .
"and title '{$this->other['title']}' before the slot with id '{$this->other['firstslotid']}' " .
"and slot number '{$this->other['firstslotnumber']}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['firstslotid'])) {
throw new \coding_exception('The \'firstslotid\' value must be set in other.');
}
if (!isset($this->other['firstslotnumber'])) {
throw new \coding_exception('The \'firstslotnumber\' value must be set in other.');
}
if (!isset($this->other['title'])) {
throw new \coding_exception('The \'title\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_sections', 'restore' => 'quiz_section'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['firstslotid'] = ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
return $othermapped;
}
}
@@ -0,0 +1,100 @@
<?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_quiz section break deleted event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz section break deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int firstslotid: id of the slot which we will remove the section break before.
* - int firstslotnumber: slot number of the slot which we will remove the section break before.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class section_break_deleted extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_sections';
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventsectionbreakdeleted', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' deleted the section break with id '{$this->objectid}' " .
"before the slot with id '{$this->other['firstslotid']}' and slot number '{$this->other['firstslotnumber']}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['firstslotid'])) {
throw new \coding_exception('The \'firstslotid\' value must be set in other.');
}
if (!isset($this->other['firstslotnumber'])) {
throw new \coding_exception('The \'firstslotnumber\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_sections', 'restore' => 'quiz_section'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['firstslotid'] = ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
return $othermapped;
}
}
@@ -0,0 +1,101 @@
<?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_quiz section shuffle updated event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz section shuffle updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - bool shuffle: shuffle option value.
* - int firstslotnumber: slot number of the slot which is right after the section break.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class section_shuffle_updated extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_sections';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventsectionshuffleupdated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' updated the section with id '{$this->objectid}' " .
"before the slot number '{$this->other['firstslotnumber']}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'. " .
"Its shuffle option was set to '{$this->other['shuffle']}'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['firstslotnumber'])) {
throw new \coding_exception('The \'firstslotnumber\' value must be set in other.');
}
if (!isset($this->other['shuffle'])) {
throw new \coding_exception('The \'shuffle\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_sections', 'restore' => 'quiz_section'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,104 @@
<?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_quiz section title updated event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz section title updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - string newtitle: new title.
* - int firstslotid: id of the slot which is right after the section break.
* - int firstslotnumber: slot number of the slot which is right after the section break.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class section_title_updated extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_sections';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventsectiontitleupdated', 'mod_quiz');
}
public function get_description() {
$description = "The user with id '$this->userid' updated the section with id '{$this->objectid}' ";
if ($this->other['firstslotid'] && $this->other['firstslotnumber']) {
$description .= "before the slot with id '{$this->other['firstslotid']}' " .
"and slot number '{$this->other['firstslotnumber']}' ";
}
$description .= "belonging to the quiz with course module id '$this->contextinstanceid'. " .
"Its title was changed to '{$this->other['newtitle']}'.";
return $description;
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['newtitle'])) {
throw new \coding_exception('The \'newtitle\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_sections', 'restore' => 'quiz_section'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
$othermapped['firstslotid'] = ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
return $othermapped;
}
}
+100
View File
@@ -0,0 +1,100 @@
<?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_quiz slots created event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz slot created event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int slotnumber: the slot number in quiz.
* - int page: page number.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class slot_created extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventslotcreated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' created a new slot with id '{$this->objectid}' " .
"and slot number '{$this->other['slotnumber']}' " .
"on page '{$this->other['page']}' " .
"of the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['slotnumber'])) {
throw new \coding_exception('The \'slotnumber\' value must be set in other.');
}
if (!isset($this->other['page'])) {
throw new \coding_exception('The \'page\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
+94
View File
@@ -0,0 +1,94 @@
<?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_quiz slots deleted event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz slot deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int slotnumber: the slot number in quiz.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class slot_deleted extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventslotdeleted', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' deleted the slot with id '{$this->objectid}' " .
"and slot number '{$this->other['slotnumber']}' " .
"from the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['slotnumber'])) {
throw new \coding_exception('The \'slotnumber\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,115 @@
<?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_quiz\event;
/**
* The mod_quiz slot display updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - string displaynumber: the slot's customised question number value.
* }
*
* @package mod_quiz
* @copyright 2022 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class slot_displaynumber_updated extends \core\event\base {
/**
* Initialise the quiz_slots table.
*/
protected function init(): void {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Return the name of the event.
*
* @return string
*/
public static function get_name(): string {
return get_string('eventslotdisplayedquestionnumberupdated', 'mod_quiz');
}
/**
* Log describes which user customised the question number in a given slot and in which quiz.
*
* @return string
*/
public function get_description(): string {
return "The user with id '$this->userid' updated the slot with id '{$this->objectid}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'. " .
"Its customised question number value was set to '{$this->other['displaynumber']}'.";
}
/**
* Return the url object of the quiz editing page.
*
* @return \moodle_url
*/
public function get_url(): \moodle_url {
return new \moodle_url('/mod/quiz/edit.php', ['cmid' => $this->contextinstanceid]);
}
/**
* validate the data being logged.
*/
protected function validate_data(): void {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['displaynumber'])) {
throw new \coding_exception('The \'displaynumber\' value must be set in other.');
}
}
/**
* Return the mapped array.
*
* @return string[]
*/
public static function get_objectid_mapping(): array {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
/**
* Return the mapped array.
*
* @return array
*/
public static function get_other_mapping(): array {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,93 @@
<?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_quiz\event;
use core\event\base;
/**
* The quiz sub-grade that this slot contributes to has changed.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int previousgradeitem: the previous max mark value.
* - int newgradeitem: the new max mark value.
* }
*
* @package mod_quiz
* @copyright 2023 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class slot_grade_item_updated extends base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventslotgradeitemupdated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' updated the slot with id '{$this->objectid}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'. " .
"The grade item this slot contributes to was changed from '{$this->other['previousgradeitem']}' " .
"to '{$this->other['newgradeitem']}'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/editgrading.php', [
'cmid' => $this->contextinstanceid,
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!array_key_exists('previousgradeitem', $this->other)) {
throw new \coding_exception('The \'previousgradeitem\' value must be set in other.');
}
if (!array_key_exists('newgradeitem', $this->other)) {
throw new \coding_exception('The \'newgradeitem\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
return [
'quizid' => ['db' => 'quiz', 'restore' => 'quiz'],
];
}
}
@@ -0,0 +1,91 @@
<?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_quiz\event;
/**
* The mark a slot is graded out of has changed.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int previousmaxmark: the previous max mark value.
* - int newmaxmark: the new max mark value.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class slot_mark_updated extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventslotmarkupdated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' updated the slot with id '{$this->objectid}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'. " .
"Its max mark was changed from '{$this->other['previousmaxmark']}' to '{$this->other['newmaxmark']}'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['previousmaxmark'])) {
throw new \coding_exception('The \'previousmaxmark\' value must be set in other.');
}
if (!isset($this->other['newmaxmark'])) {
throw new \coding_exception('The \'newmaxmark\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
+109
View File
@@ -0,0 +1,109 @@
<?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_quiz slots moved event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz slot moved event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - int previousslotnumber: the previous slot number in quiz.
* - int afterslotnumber: the new slot number in quiz.
* - int page: the page of new slot position in quiz.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class slot_moved extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventslotmoved', 'mod_quiz');
}
public function get_description() {
if ($this->other['afterslotnumber'] == 0) {
$newposition = 'before the first slot';
} else {
$newposition = "after slot number '{$this->other['afterslotnumber']}'";
}
return "The user with id '$this->userid' has moved the slot with id '{$this->objectid}' " .
"and slot number '{$this->other['previousslotnumber']}' to the new position $newposition " .
"on page '{$this->other['page']}' belonging to the quiz with course module id '$this->contextinstanceid'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['previousslotnumber'])) {
throw new \coding_exception('The \'previousslotnumber\' value must be set in other.');
}
if (!isset($this->other['afterslotnumber'])) {
throw new \coding_exception('The \'afterslotnumber\' value must be set in other.');
}
if (!isset($this->other['page'])) {
throw new \coding_exception('The \'page\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,94 @@
<?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_quiz slots require previous updated event.
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
/**
* The mod_quiz slot require previous updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* - bool requireprevious: the slot's require previous value.
* }
*
* @package mod_quiz
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class slot_requireprevious_updated extends \core\event\base {
protected function init() {
$this->data['objecttable'] = 'quiz_slots';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
public static function get_name() {
return get_string('eventslotrequirepreviousupdated', 'mod_quiz');
}
public function get_description() {
return "The user with id '$this->userid' updated the slot with id '{$this->objectid}' " .
"belonging to the quiz with course module id '$this->contextinstanceid'. " .
"Its require previous value was set to '{$this->other['requireprevious']}'.";
}
public function get_url() {
return new \moodle_url('/mod/quiz/edit.php', [
'cmid' => $this->contextinstanceid
]);
}
protected function validate_data() {
parent::validate_data();
if (!isset($this->objectid)) {
throw new \coding_exception('The \'objectid\' value must be set.');
}
if (!isset($this->contextinstanceid)) {
throw new \coding_exception('The \'contextinstanceid\' value must be set.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
if (!isset($this->other['requireprevious'])) {
throw new \coding_exception('The \'requireprevious\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_slots', 'restore' => 'quiz_question_instance'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,109 @@
<?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_quiz user override created event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz user override created event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class user_override_created extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_overrides';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventoverridecreated', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' created the override with id '$this->objectid' for the quiz with " .
"course module id '$this->contextinstanceid' for the user with id '{$this->relateduserid}'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/overrideedit.php', ['id' => $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['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_overrides', 'restore' => 'quiz_override'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,109 @@
<?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_quiz user override deleted event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz user override deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class user_override_deleted extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_overrides';
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventoverridedeleted', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' deleted the override with id '$this->objectid' for the quiz with " .
"course module id '$this->contextinstanceid' for the user with id '{$this->relateduserid}'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/overrides.php', ['cmid' => $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.');
}
if (!isset($this->other['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_overrides', 'restore' => 'quiz_override'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}
@@ -0,0 +1,110 @@
<?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_quiz user override updated event.
*
* @package mod_quiz
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_quiz\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_quiz user override updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int quizid: the id of the quiz.
* }
*
* @package mod_quiz
* @since Moodle 2.7
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class user_override_updated extends \core\event\base {
/**
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'quiz_overrides';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventoverrideupdated', 'mod_quiz');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' updated the override with id '$this->objectid' for the quiz with " .
"course module id '$this->contextinstanceid' for the user with id '{$this->relateduserid}'.";
}
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/quiz/overrideedit.php', ['id' => $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['quizid'])) {
throw new \coding_exception('The \'quizid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return ['db' => 'quiz_overrides', 'restore' => 'quiz_override'];
}
public static function get_other_mapping() {
$othermapped = [];
$othermapped['quizid'] = ['db' => 'quiz', 'restore' => 'quiz'];
return $othermapped;
}
}