From 1389487a1cb89e3bf8a7f3ad126ad4b48fd617cf Mon Sep 17 00:00:00 2001 From: Ferran Recio Date: Mon, 23 Aug 2021 11:38:07 +0200 Subject: [PATCH 1/2] MDL-71209 mod_assign: fix anonymous submission behat --- .../bulk_release_anon_submissions.feature | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/mod/assign/tests/behat/bulk_release_anon_submissions.feature b/mod/assign/tests/behat/bulk_release_anon_submissions.feature index cd0812bb490..da384769cd8 100644 --- a/mod/assign/tests/behat/bulk_release_anon_submissions.feature +++ b/mod/assign/tests/behat/bulk_release_anon_submissions.feature @@ -31,9 +31,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions | Anonymous submissions | Yes | And I log out # Add a submission. - And I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as "student1" Then I should not see "Feedback" And I should see "Not marked" in the "Grading status" "table_row" And I press "Add submission" @@ -42,9 +40,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions And I press "Save changes" And I log out # Add another submission. - And I log in as "student2" - And I am on "Course 1" course homepage - When I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as "student2" Then I should not see "Feedback" And I should see "Not marked" in the "Grading status" "table_row" And I press "Add submission" @@ -53,9 +49,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions And I press "Save changes" And I log out # Mark the submissions. - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as "teacher1" And I navigate to "View all submissions" in current page administration Then I should see "Not marked" in the "I'm student1's submission" "table_row" And I click on "Grade" "link" in the "I'm student1's submission" "table_row" @@ -64,7 +58,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions And I set the field "Feedback comments" to "Great job!" And I set the field "Notify students" to "0" And I press "Save changes" - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page And I navigate to "View all submissions" in current page administration Then I should see "Not marked" in the "I'm student2's submission" "table_row" And I click on "Grade" "link" in the "I'm student2's submission" "table_row" @@ -73,7 +67,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions And I set the field "Feedback comments" to "Great job!" And I set the field "Notify students" to "0" And I press "Save changes" - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page And I navigate to "View all submissions" in current page administration Then I should see "In review" in the "I'm student1's submission" "table_row" And I should see "In review" in the "I'm student2's submission" "table_row" @@ -88,7 +82,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions And I set the field "Marking workflow state" to "Released" And I set the field "Notify students" to "No" And I press "Save changes" - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page And I navigate to "View all submissions" in current page administration Then I should see "Released" in the "I'm student1's submission" "table_row" And I should see "Released" in the "I'm student2's submission" "table_row" @@ -105,9 +99,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions Then I should not see "50" And I should not see "Great job!" And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as "teacher1" And I navigate to "View all submissions" in current page administration And I set the field "Grading action" to "Reveal student identities" And I press "Continue" @@ -138,7 +130,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions And I set the field "Marking workflow state" to "Released" And I set the field "Notify students" to "No" And I press "Save changes" - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page And I navigate to "View all submissions" in current page administration Then I should see "Released" in the "Student 1" "table_row" And I should see "Released" in the "Student 2" "table_row" From 0b18d478a25f4f435f7569f4119bbe344b8dd714 Mon Sep 17 00:00:00 2001 From: Ferran Recio Date: Mon, 23 Aug 2021 12:49:22 +0200 Subject: [PATCH 2/2] MDL-71209 courseformat: disable course index in mod --- course/format/tests/behat/course_courseindex.feature | 2 -- course/lib.php | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/course/format/tests/behat/course_courseindex.feature b/course/format/tests/behat/course_courseindex.feature index bee26d30d91..4d1399eb757 100644 --- a/course/format/tests/behat/course_courseindex.feature +++ b/course/format/tests/behat/course_courseindex.feature @@ -29,8 +29,6 @@ Feature: Course index depending on role Given I log in as "teacher1" When I am on "Course 1" course homepage Then I should see "Open course index drawer" - And I follow "Activity sample 1" - And I should see "Open course index drawer" @javascript Scenario: Course index as a teacher diff --git a/course/lib.php b/course/lib.php index b04d05c959a..d95981204b5 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3860,8 +3860,8 @@ function core_course_core_calendar_get_valid_event_timestart_range(\calendar_eve */ function core_course_drawer(): string { global $PAGE; - // Only course and mod pages are able to render course index. - if (!preg_match('/^(mod|course).*/', $PAGE->pagetype)) { + // Only course are able to render course index. + if (!preg_match('/^(course).*/', $PAGE->pagetype)) { return ''; }