Skip to content

Commit

Permalink
MDL-74986 mod_bigbluebuttonbn: Outline display is a bit verbose
Browse files Browse the repository at this point in the history
* Change language string to shorten the user outline display
  • Loading branch information
laurentdavid committed Oct 13, 2022
1 parent e4c5a12 commit 76e77b6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
6 changes: 3 additions & 3 deletions mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php
Expand Up @@ -375,9 +375,9 @@
$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';
Expand Down
37 changes: 34 additions & 3 deletions mod/bigbluebuttonbn/tests/local/helpers/user_info_test.php
Expand Up @@ -53,11 +53,12 @@ public function test_get_user_info_outline() {
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
*
Expand All @@ -78,7 +79,37 @@ public function test_get_user_info_outline_several_logs() {

[$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);
}
Expand Down

0 comments on commit 76e77b6

Please sign in to comment.