diff --git a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php index 54694a61651..f2b04efd7c8 100644 --- a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php @@ -375,9 +375,9 @@ $string['mod_form_field_disablenote'] = 'Disable shared notes'; $string['mod_form_field_hideuserlist'] = 'Hide user list'; $string['mod_form_field_lockonjoin'] = 'Lock settings on join'; $string['mod_form_locksettings'] = 'Lock settings'; -$string['report_join_info'] = 'Has joined the room {$a} time(s)'; -$string['report_play_recording_info'] = 'Has played a recording {$a} time(s)'; -$string['report_room_view'] = 'Has viewed the room'; +$string['report_join_info'] = '{$a} meeting(s)'; +$string['report_play_recording_info'] = '{$a} recording(s) played'; +$string['report_room_view'] = 'viewed'; $string['starts_at'] = 'Starts'; $string['started_at'] = 'Started'; $string['ends_at'] = 'Ends'; diff --git a/mod/bigbluebuttonbn/tests/local/helpers/user_info_test.php b/mod/bigbluebuttonbn/tests/local/helpers/user_info_test.php index 79c841b7013..1334a2d9863 100644 --- a/mod/bigbluebuttonbn/tests/local/helpers/user_info_test.php +++ b/mod/bigbluebuttonbn/tests/local/helpers/user_info_test.php @@ -53,11 +53,12 @@ class user_info_test extends \advanced_testcase { logger::log_recording_played_event($instance, $recordings[0]->id); [$logjoins, $logtimes] = user_info::get_user_info_outline($this->get_course(), $user, $bbactivitycm); $this->assertEquals([ - 'Has joined the room 1 time(s)', - 'Has played a recording 1 time(s)' + '1 meeting(s)', + '1 recording(s) played' ], $logjoins); $this->assertCount(2, $logtimes); } + /** * Test user info outline with several logs * @@ -78,7 +79,37 @@ class user_info_test extends \advanced_testcase { [$logjoins, $logtimes] = user_info::get_user_info_outline($this->get_course(), $user, $bbactivitycm); $this->assertEquals([ - 'Has joined the room 2 time(s)', + '2 meeting(s)', + ], $logjoins); + $this->assertCount(1, $logtimes); + } + + /** + * Test user info outline for view events + * + * @return void + */ + public function test_get_user_info_outline_view() { + $this->initialise_mock_server(); + $this->resetAfterTest(); + + $generator = $this->getDataGenerator(); + $user = $generator->create_and_enrol($this->get_course()); + list($bbactivitycontext, $bbactivitycm, $bbactivity) = $this->create_instance( + null, + ['completion' => 2, 'completionview' => 1]); + $this->setUser($user); + + // Now create a couple of logs. + $instance = instance::get_from_instanceid($bbactivity->id); + // View it twice. + bigbluebuttonbn_view($instance->get_instance_data(), $instance->get_course(), $instance->get_cm(), + $instance->get_context()); + bigbluebuttonbn_view($instance->get_instance_data(), $instance->get_course(), $instance->get_cm(), + $instance->get_context()); + [$logjoins, $logtimes] = user_info::get_user_info_outline($this->get_course(), $user, $bbactivitycm); + $this->assertEquals([ + 'viewed', ], $logjoins); $this->assertCount(1, $logtimes); }