Skip to content

Commit

Permalink
Merge branch 'MDL-73220' of https://github.com/call-learning/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Dec 9, 2021
2 parents 4c6151a + 8c1568d commit e4ed6da
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,17 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity_viewed extends base
class course_module_viewed extends \core\event\course_module_viewed
{
/**
* Init method.
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' viewed the bigbluebuttonbn activity " .
"with id '##objectid' for the course id '##courseid'.";
}

/**
* Return event name.
*
* @return string
*/
public static function get_name() {
return get_string('event_activity_viewed', 'bigbluebuttonbn');
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'bigbluebuttonbn';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mod/bigbluebuttonbn/classes/event/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class events {
*/
public static $events = [
'create' => 'activity_created',
'view' => 'activity_viewed',
'view' => 'course_module_viewed',
'update' => 'activity_updated',
'delete' => 'activity_deleted',
'meeting_create' => 'meeting_created',
Expand Down
1 change: 0 additions & 1 deletion mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@
$string['view_recording_yui_show_all'] = 'Show all';

$string['event_activity_created'] = 'Activity created';
$string['event_activity_viewed'] = 'Activity viewed';
$string['event_activity_deleted'] = 'Activity deleted';
$string['event_activity_updated'] = 'Activity updated';
$string['event_meeting_created'] = 'Meeting created';
Expand Down
2 changes: 1 addition & 1 deletion mod/bigbluebuttonbn/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ function bigbluebuttonbn_view($bigbluebuttonbn, $course, $cm, $context) {
'objectid' => $bigbluebuttonbn->id
];

$event = \mod_bigbluebuttonbn\event\activity_viewed::create($params); // Fix event name.
$event = \mod_bigbluebuttonbn\event\course_module_viewed::create($params); // Fix event name.
$event->add_record_snapshot('course_modules', $cm->get_course_module_record());
$event->add_record_snapshot('course', $course);
$event->add_record_snapshot('bigbluebuttonbn', $bigbluebuttonbn);
Expand Down
2 changes: 1 addition & 1 deletion mod/bigbluebuttonbn/tests/completion_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function test_view() {
$event = reset($events);

// Checking that the event contains the expected values.
$this->assertInstanceOf('\mod_bigbluebuttonbn\event\activity_viewed', $event);
$this->assertInstanceOf('\mod_bigbluebuttonbn\event\course_module_viewed', $event);
$this->assertEquals($bbactivitycontext, $event->get_context());
$url = new \moodle_url('/mod/bigbluebuttonbn/view.php', ['id' => $bbactivitycontext->instanceid]);
$this->assertEquals($url, $event->get_url());
Expand Down

0 comments on commit e4ed6da

Please sign in to comment.