diff --git a/classes/structure.php b/classes/structure.php index 6a16719..44c3302 100644 --- a/classes/structure.php +++ b/classes/structure.php @@ -440,8 +440,15 @@ class mod_attendance_structure { $sess->description = $description; $sess->lasttaken = 0; $sess->lasttakenby = 0; - $sess->studentscanmark = 0; - $sess->studentpassword = ''; + if (!isset($sess->studentscanmark)) { + $sess->studentscanmark = 0; + } + if (!isset($sess->studentpassword)) { + $sess->studentpassword = ''; + } + if (!isset($sess->subnet)) { + $sess->subnet = ''; + } $event->add_record_snapshot('attendance_sessions', $sess); $event->trigger(); diff --git a/tests/behat/report.feature b/tests/behat/report.feature index 37a993f..0163282 100644 --- a/tests/behat/report.feature +++ b/tests/behat/report.feature @@ -126,7 +126,7 @@ Feature: Visiting reports | id_sessiontype_1 | 1 | | id_groups | Group1 | And I click on "id_submitbutton" "button" - Then I should see "3AM - 4AM" + Then I should see "3AM - 4AM" And "Group: Group1" "text" should exist in the "3AM - 4AM" "table_row" When I click on "Take attendance" "link" in the "3AM - 4AM" "table_row" @@ -164,7 +164,7 @@ Feature: Visiting reports | id_sestime_starthour | 03 | | id_sestime_endhour | 04 | And I click on "id_submitbutton" "button" - Then I should see "3AM - 4AM" + Then I should see "3AM - 4AM" When I click on "Take attendance" "link" in the "3AM - 4AM" "table_row" # Present @@ -176,7 +176,7 @@ Feature: Visiting reports | id_sestime_starthour | 05 | | id_sestime_endhour | 06 | And I click on "id_submitbutton" "button" - Then I should see "5AM - 6AM" + Then I should see "5AM - 6AM" When I follow "Report" And I click on "Summary" "link" in the "All" "table_row"