mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-40063 mod_quiz: replaced 'addcategory' add_to_log call with an event
This commit is contained in:
parent
5e8f736565
commit
58940b190a
5 changed files with 167 additions and 3 deletions
|
@ -404,6 +404,15 @@ class question_category_object {
|
|||
$cat->sortorder = 999;
|
||||
$cat->stamp = make_unique_id_code();
|
||||
$categoryid = $DB->insert_record("question_categories", $cat);
|
||||
|
||||
// Log the creation of this category.
|
||||
$params = array(
|
||||
'objectid' => $categoryid,
|
||||
'contextid' => $contextid
|
||||
);
|
||||
$event = \core\event\question_category_created::create($params);
|
||||
$event->trigger();
|
||||
|
||||
if ($return) {
|
||||
return $categoryid;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue