From 37b6eea44f4e0130a9530cf83234da47d8a98aa2 Mon Sep 17 00:00:00 2001 From: Laurent David Date: Mon, 8 Jul 2024 10:44:39 +0200 Subject: [PATCH 1/2] MDL-81265 mod_workshop: Fix accessibility issues * Page title should be h2 * Contrasts in the table headers (for submission, assessment and grading) should be 4:1 at least --- mod/workshop/renderer.php | 2 +- mod/workshop/styles.css | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index 3109026b086..0c33d404cf3 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -1261,7 +1261,7 @@ class mod_workshop_renderer extends plugin_renderer_base { $output = ''; $output .= $this->render_action_buttons($workshop, $userplan); - $output .= $this->heading(format_string($currentphasetitle), 3, null, 'mod_workshop-userplanheading'); + $output .= $this->heading(format_string($currentphasetitle), 2, null, 'mod_workshop-userplanheading'); $output .= $this->render($userplan); $output .= $this->view_submissions_report($workshop, $userplan, $page, $sortby, $sorthow); diff --git a/mod/workshop/styles.css b/mod/workshop/styles.css index 43164e63550..779aa7a0529 100644 --- a/mod/workshop/styles.css +++ b/mod/workshop/styles.css @@ -243,15 +243,16 @@ .path-mod-workshop .userplan dt { vertical-align: bottom; white-space: normal; - color: #999; - border-bottom: 1px solid #ddd; + color: #495057; + background-color: #f5f5f5; + border-bottom: 1px solid #ced4da; padding: 3px; } .path-mod-workshop .userplan dt.active { vertical-align: top; - color: black; - border: 1px solid #ddd; + color: #212529; + border: 1px solid #ced4da; border-bottom: 0; border-top: 0; background: #e7f1c3; @@ -322,7 +323,7 @@ .path-mod-workshop .userplan dd { vertical-align: top; - border-right: 1px solid #ddd; + border-right: 1px solid #ced4da; background-color: #f5f5f5; margin: 0; min-height: 180px; @@ -335,7 +336,7 @@ .path-mod-workshop .userplan dd a:hover, .path-mod-workshop .userplan dd a:visited, .path-mod-workshop .userplan dd a:active { - color: #999; + color: #495057; } .path-mod-workshop .userplan dd.active, @@ -344,7 +345,7 @@ .path-mod-workshop .userplan dd.active a:hover, .path-mod-workshop .userplan dd.active a:visited, .path-mod-workshop .userplan dd.active a:active { - color: black; + color: #212529; } .path-mod-workshop .userplan dd.lastcol { From edafd17fc4dcae1c4728c2c2fa752f73e99f4db6 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 11 Jul 2024 11:49:20 +0800 Subject: [PATCH 2/2] MDL-81265 mod_workshop: Verify "Setup phase" heading with "should exist" --- mod/workshop/tests/behat/submission_types.feature | 10 +++++----- mod/workshop/tests/behat/workshop_edit_form.feature | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mod/workshop/tests/behat/submission_types.feature b/mod/workshop/tests/behat/submission_types.feature index e72c111792a..ea3411c49c6 100644 --- a/mod/workshop/tests/behat/submission_types.feature +++ b/mod/workshop/tests/behat/submission_types.feature @@ -38,30 +38,30 @@ Feature: Submission types | submissiontypefileavailable | 1 | | submissiontypefilerequired | 1 | And I press "Save and display" - Then I should see "Setup phase" in the "h3#mod_workshop-userplanheading" "css_element" + Then "Setup phase" "heading" should exist When I navigate to "Settings" in current page administration And I set the following fields to these values: | submissiontypetextrequired | 0 | And I press "Save and display" - Then I should see "Setup phase" in the "h3#mod_workshop-userplanheading" "css_element" + Then "Setup phase" "heading" should exist When I navigate to "Settings" in current page administration And I set the following fields to these values: | submissiontypetextrequired | 1 | | submissiontypefilerequired | 0 | And I press "Save and display" - Then I should see "Setup phase" in the "h3#mod_workshop-userplanheading" "css_element" + Then "Setup phase" "heading" should exist When I navigate to "Settings" in current page administration And I set the following fields to these values: | submissiontypefileavailable | 0 | And I press "Save and display" - Then I should see "Setup phase" in the "h3#mod_workshop-userplanheading" "css_element" + Then "Setup phase" "heading" should exist When I navigate to "Settings" in current page administration And I set the following fields to these values: | submissiontypefileavailable | 1 | | submissiontypefilerequired | 1 | | submissiontypetextavailable | 0 | And I press "Save and display" - Then I should see "Setup phase" in the "h3#mod_workshop-userplanheading" "css_element" + Then "Setup phase" "heading" should exist @javascript @_file_upload Scenario: All submission fields required diff --git a/mod/workshop/tests/behat/workshop_edit_form.feature b/mod/workshop/tests/behat/workshop_edit_form.feature index 6026735386a..b9c4922b7a0 100644 --- a/mod/workshop/tests/behat/workshop_edit_form.feature +++ b/mod/workshop/tests/behat/workshop_edit_form.feature @@ -42,4 +42,4 @@ Feature: Workshop assessment with grade to pass And I should see "You must enter a number here." And I set the field "Assessment grade to pass" to "10" And I press "Save and display" - Then I should see "Setup phase" in the "h3#mod_workshop-userplanheading" "css_element" + Then "Setup phase" "heading" should exist