Skip to content

Commit

Permalink
add cm instance list viewed event
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamara Gunkel committed Dec 6, 2021
1 parent c0f8560 commit af4a0db
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions classes/event/course_module_instance_list_viewed.php
Original file line number Diff line number Diff line change
@@ -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_opencast instance list viewed event.
*
* @package mod_opencast
* @copyright 2021 Tamara Gunkel <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_opencast\event;

defined('MOODLE_INTERNAL') || die();

/**
* The mod_opencast instance list viewed event class.
*
* @package mod_opencast
* @copyright 2021 Tamara Gunkel <[email protected]>
* @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.
}
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$coursecontext = context_course::instance($course->id);

$event = \mod_opencast\event\course_module_instance_list_viewed::create(array(
'context' => $modulecontext
'context' => $coursecontext
));
$event->add_record_snapshot('course', $course);
$event->trigger();
Expand Down

0 comments on commit af4a0db

Please sign in to comment.