diff --git a/classes/structure.php b/classes/structure.php index 1cc95cb..8821b49 100644 --- a/classes/structure.php +++ b/classes/structure.php @@ -591,7 +591,7 @@ class mod_attendance_structure { $extrafields = get_extra_user_fields($this->context, $fields); $fields = array_merge($fields, $extrafields); - $userfields = user_picture::fields('u',$fields); + $userfields = user_picture::fields('u', $fields); if (empty($this->pageparams->sort)) { $this->pageparams->sort = ATT_SORT_DEFAULT; diff --git a/renderer.php b/renderer.php index e62ea88..dd1449e 100644 --- a/renderer.php +++ b/renderer.php @@ -986,7 +986,6 @@ class mod_attendance_renderer extends plugin_renderer_base { $rows[] = $row; - foreach ($reportdata->users as $user) { $row = new html_table_row(); $row->cells[] = $this->build_data_cell($this->user_picture($user)); diff --git a/tests/behat/attendance_mod.feature b/tests/behat/attendance_mod.feature index e36eaf3..30e0917 100644 --- a/tests/behat/attendance_mod.feature +++ b/tests/behat/attendance_mod.feature @@ -26,21 +26,20 @@ Feature: Teachers and Students can record session attendance | C1 | teacher1 | editingteacher | ##yesterday## | And I log in as "teacher1" - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I follow "Add a block" And I follow "Administration" And I add a "Attendance" to section "1" and I fill the form with: | Name | Attendance | And I log out And I log in as "student1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I should see "Attendance" And I log out Scenario: Students can mark their own attendance Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Add" And I set the field "Allow students to record own attendance" to "1" @@ -50,7 +49,7 @@ Feature: Teachers and Students can record session attendance And I click on "id_submitbutton" "button" And I log out And I log in as "student1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Submit attendance" And I set the field "Present" to "1" @@ -58,7 +57,7 @@ Feature: Teachers and Students can record session attendance And I should see "Self-recorded" And I log out When I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I expand "Reports" node And I follow "Logs" And I click on "Get these logs" "button" @@ -66,7 +65,7 @@ Feature: Teachers and Students can record session attendance Scenario: Teachers can view low grade report and send a message Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Add" And I set the following fields to these values: @@ -87,7 +86,7 @@ Feature: Teachers and Students can record session attendance Scenario: Export report includes id number, department and institution Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Add" And I set the following fields to these values: diff --git a/tests/behat/calendar_features.feature b/tests/behat/calendar_features.feature index e0dd02d..d86bc76 100644 --- a/tests/behat/calendar_features.feature +++ b/tests/behat/calendar_features.feature @@ -15,8 +15,7 @@ Feature: Test the calendar related features in the attendance module | C1 | teacher1 | editingteacher | ##yesterday## | And I log in as "teacher1" - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add the "Upcoming events" block And I add a "Attendance" to section "1" and I fill the form with: | Name | Test attendance | @@ -24,14 +23,14 @@ Feature: Test the calendar related features in the attendance module Scenario: Calendar events can be created automatically with sessions creation Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Test attendance" And I follow "Add session" And I set the following fields to these values: | id_sestime_starthour | 01 | | id_sestime_endhour | 02 | And I click on "id_submitbutton" "button" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Go to calendar" And I should see "Test attendance" And I log out diff --git a/tests/behat/defaultstatus.feature b/tests/behat/defaultstatus.feature index 63b2ab4..9701fa6 100644 --- a/tests/behat/defaultstatus.feature +++ b/tests/behat/defaultstatus.feature @@ -22,8 +22,7 @@ Feature: Admin can set default status set for use in new attendance @javascript Scenario: Modified default status set added to new attendance Given I log in as "teacher1" - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add a "Attendance" to section "1" and I fill the form with: | Name | Attendance1 | And I follow "Attendance1" diff --git a/tests/behat/extra_features.feature b/tests/behat/extra_features.feature index d0e2541..0029126 100644 --- a/tests/behat/extra_features.feature +++ b/tests/behat/extra_features.feature @@ -21,15 +21,14 @@ Feature: Test the various new features in the attendance module | C1 | student3 | student | ##yesterday## | And I log in as "teacher1" - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add a "Attendance" to section "1" and I fill the form with: | Name | Test attendance | And I log out Scenario: A teacher can create and update temporary users Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Test attendance" And I follow "Temporary users" @@ -61,7 +60,7 @@ Feature: Test the various new features in the attendance module Scenario: A teacher can take attendance for temporary users Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Test attendance" And I follow "Temporary users" And I set the following fields to these values: @@ -124,7 +123,7 @@ Feature: Test the various new features in the attendance module | Group2 | student3 | And I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Test attendance" And I follow "Add" And I set the following fields to these values: @@ -147,7 +146,7 @@ Feature: Test the various new features in the attendance module Scenario: A teacher can create and use multiple status lists Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Test attendance" And I follow "Status set" And I set the field "jump" to "New set of statuses" @@ -196,7 +195,7 @@ Feature: Test the various new features in the attendance module Scenario: A teacher can use the radio buttons to set attendance values for all users Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Test attendance" And I follow "Add" And I set the following fields to these values: diff --git a/tests/behat/preferences.feature b/tests/behat/preferences.feature index b55c24e..83e68ab 100644 --- a/tests/behat/preferences.feature +++ b/tests/behat/preferences.feature @@ -18,8 +18,7 @@ Feature: Teachers can't change status variables to have empty acronyms or descri | C1 | teacher1 | editingteacher | ##yesterday## | And I log in as "teacher1" - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add a "Attendance" to section "1" and I fill the form with: | Name | Attendancepreftest | And I follow "Attendancepreftest" diff --git a/tests/behat/report.feature b/tests/behat/report.feature index 2bc035d..850afa0 100644 --- a/tests/behat/report.feature +++ b/tests/behat/report.feature @@ -16,8 +16,7 @@ Feature: Visiting reports | C1 | teacher1 | editingteacher | ##yesterday## | And I log in as "teacher1" - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add a "Attendance" to section "1" and I fill the form with: | Name | Attendance | And I follow "Attendance" @@ -33,7 +32,7 @@ Feature: Visiting reports Scenario: Teacher takes attendance Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Edit settings" Then I set the following fields to these values: @@ -67,7 +66,7 @@ Feature: Visiting reports Scenario: Teacher changes the maximum points in the attendance settings Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Edit settings" Then I set the following fields to these values: @@ -107,7 +106,7 @@ Feature: Visiting reports | Group1 | student1 | When I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Edit settings" And I set the following fields to these values: @@ -149,7 +148,7 @@ Feature: Visiting reports Scenario: Teacher visit summary report Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Edit settings" And I set the following fields to these values: @@ -193,7 +192,7 @@ Feature: Visiting reports Scenario: Student visit user report Given I log in as "teacher1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "Edit settings" Then I set the following fields to these values: @@ -226,7 +225,7 @@ Feature: Visiting reports Then I log out When I log in as "student1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Attendance" And I follow "All"