diff --git a/report/log/tests/behat/user_log.feature b/report/log/tests/behat/user_log.feature index da4dc9ff40e..b55a8ae203e 100644 --- a/report/log/tests/behat/user_log.feature +++ b/report/log/tests/behat/user_log.feature @@ -28,14 +28,6 @@ Feature: User can view activity log. And the following config values are set as admin: | fullnamedisplay | firstname | | alternativefullnameformat | middlename, alternatename, firstname, lastname | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name | - | Description | Submit your online text | - | assignsubmission_onlinetext_enabled | 1 | - | assignsubmission_file_enabled | 0 | - And I log out And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test assignment name" diff --git a/report/loglive/classes/table_log.php b/report/loglive/classes/table_log.php index fdc7ed63279..6dfa2372e35 100644 --- a/report/loglive/classes/table_log.php +++ b/report/loglive/classes/table_log.php @@ -379,7 +379,7 @@ class report_loglive_table_log extends table_sql { $userfieldsapi->get_sql('', false, '', '', false)->selects . " FROM {user} WHERE id " . $usql, $uparams); foreach ($users as $userid => $user) { - $this->userfullnames[$userid] = fullname($user); + $this->userfullnames[$userid] = fullname($user, has_capability('moodle/site:viewfullnames', $this->get_context())); } } diff --git a/report/loglive/tests/behat/loglive_report.feature b/report/loglive/tests/behat/loglive_report.feature index f0699e6d871..b6ce06e2503 100644 --- a/report/loglive/tests/behat/loglive_report.feature +++ b/report/loglive/tests/behat/loglive_report.feature @@ -8,6 +8,15 @@ Feature: In a report, admin can see loglive data Given the following "courses" exist: | fullname | shortname | category | groupmode | | Course 1 | C1 | 0 | 1 | + And the following "users" exist: + | username | firstname | lastname | email | idnumber | middlename | alternatename | firstnamephonetic | lastnamephonetic | + | student1 | Grainne | Beauchamp | student1@example.com | s1 | Ann | Jill | Gronya | Beecham | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + And the following config values are set as admin: + | fullnamedisplay | firstname | + | alternativefullnameformat | middlename, alternatename, firstname, lastname | And I log in as "admin" And I navigate to "Plugins > Logging > Manage log stores" in site administration And I click on "Enable" "link" in the "Legacy log" "table_row" @@ -72,3 +81,24 @@ Feature: In a report, admin can see loglive data And I wait "8" seconds And I should see "Test name2" And I log out + + @javascript + Scenario: Check course loglive report entries for a user + Given I log out + And I log in as "student1" + And I am on "Course 1" course homepage + And I follow "Test name" + And I log out + And I log in as "admin" + And I am on "Course 1" course homepage + And I navigate to "Reports > Live logs" in site administration + When I set the field "reader" to "Standard log" + Then I should see "Course module viewed" + And I should see "Test name" + And I should see "Ann, Jill, Grainne, Beauchamp" + And I set the field "reader" to "Legacy log" + And I wait to be redirected + And I should see "course_add mod" + And I wait "8" seconds + And I should see "Test name" + And I log out diff --git a/report/progress/tests/behat/activity_completion_report.feature b/report/progress/tests/behat/activity_completion_report.feature index 51ae6cfa65c..62e4d63fabd 100644 --- a/report/progress/tests/behat/activity_completion_report.feature +++ b/report/progress/tests/behat/activity_completion_report.feature @@ -56,14 +56,10 @@ Feature: Teacher can view and override users' activity completion data via the p # Student can now complete the activities again, via normal means. Then I log in as "student1" And I am on "Course 1" course homepage - And the manual completion button of "my assignment" overridden by "Teacher One" is displayed as "Mark as done" - And the "View" completion condition of "my assignment 2" overridden by "Teacher One" is displayed as "todo" + And the manual completion button of "my assignment" overridden by "Teacher" is displayed as "Mark as done" + And the "View" completion condition of "my assignment 2" overridden by "Teacher" is displayed as "todo" And I toggle the manual completion state of "my assignment" And the manual completion button of "my assignment" is displayed as "Done" - And "Not completed: my assignment (set by Teacher). Select to mark as complete." "icon" should exist in the "my assignment" "list_item" - And "Not completed: my assignment 2 (set by Teacher)" "icon" should exist in the "my assignment 2" "list_item" - And I click on "Not completed: my assignment (set by Teacher). Select to mark as complete." "icon" - And "Completed: my assignment. Select to mark as not complete." "icon" should exist in the "my assignment" "list_item" And I click on "my assignment 2" "link" And I am on "Course 1" course homepage And the "View" completion condition of "my assignment 2" is displayed as "done" @@ -96,8 +92,7 @@ Feature: Teacher can view and override users' activity completion data via the p # Then as a student, confirm that automatic completion checks are no longer triggered (such as after an assign submission). Then I log in as "student1" And I am on "Course 1" course homepage - And the "Receive a grade" completion condition of "my assignment 3" overridden by "Teacher One" is displayed as "done" - And "Completed: my assignment 3 (set by Teacher)" "icon" should exist in the "my assignment 3" "list_item" + And the "Receive a grade" completion condition of "my assignment 3" overridden by "Teacher" is displayed as "done" And I click on "my assignment 3" "link" And I press "Add submission" And I set the following fields to these values: @@ -105,16 +100,10 @@ Feature: Teacher can view and override users' activity completion data via the p And I press "Save changes" And I should see "Submitted for grading" And I am on "Course 1" course homepage - And the "Receive a grade" completion condition of "my assignment 3" overridden by "Teacher One" is displayed as "done" + And the "Receive a grade" completion condition of "my assignment 3" overridden by "Teacher" is displayed as "done" # And Confirm that manual completion changes are still allowed. And I am on "Course 1" course homepage - And the manual completion button of "my assignment" overridden by "Teacher One" is displayed as "Done" + And the manual completion button of "my assignment" overridden by "Teacher" is displayed as "Done" And I toggle the manual completion state of "my assignment" And the manual completion button of "my assignment" is displayed as "Mark as done" - And "Completed: my assignment 3 (set by Teacher)" "icon" should exist in the "my assignment 3" "list_item" - # And Confirm that manual completion changes are still allowed. - And I am on "Course 1" course homepage - And "Completed: my assignment (set by Teacher). Select to mark as not complete." "icon" should exist in the "my assignment" "list_item" - And I click on "Completed: my assignment (set by Teacher). Select to mark as not complete." "icon" - And "Not completed: my assignment. Select to mark as complete." "icon" should exist in the "my assignment" "list_item" And I log out