From 29d621c8fb8a92cd3435f75d52df863cd149decd Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 12 Sep 2025 14:57:20 +0100 Subject: [PATCH] MDL-86599 assignment: add hidden captions to the table in the assign UI This helps screen-reader users trying to navigate quickly to the right table. --- mod/assign/classes/output/renderer.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mod/assign/classes/output/renderer.php b/mod/assign/classes/output/renderer.php index 54f1b589d92..03ae0fa80b2 100644 --- a/mod/assign/classes/output/renderer.php +++ b/mod/assign/classes/output/renderer.php @@ -304,6 +304,8 @@ class renderer extends \plugin_renderer_base { $o .= $this->output->box_start('boxaligncenter gradingsummarytable'); $t = new \html_table(); $t->attributes['class'] = 'generaltable table table-striped table-bordered'; + $t->caption = get_string('gradingsummary', 'assign'); + $t->captionhide = true; // Hidden because it matches the title above. // Visibility Status. $cell1content = get_string('hiddenfromstudents'); @@ -410,6 +412,8 @@ class renderer extends \plugin_renderer_base { $o .= $this->output->heading(get_string('feedback', 'assign'), 3); $o .= $this->output->box_start('boxaligncenter feedbacktable'); $t = new \html_table(); + $t->caption = get_string('feedback', 'assign'); + $t->captionhide = true; // Hidden because it matches the title above. // Grade. if (isset($status->gradefordisplay)) { @@ -650,6 +654,8 @@ class renderer extends \plugin_renderer_base { $t = new \html_table(); $t->attributes['class'] = 'generaltable table table-striped table-bordered'; + $t->caption = get_string('submissionstatusheading', 'assign'); + $t->captionhide = true; // Hidden because it matches the title above. $warningmsg = ''; if ($status->teamsubmissionenabled) { @@ -936,6 +942,8 @@ class renderer extends \plugin_renderer_base { $o .= $this->heading(get_string('attemptheading', 'assign', $attemptsummaryparams), 4); $t = new \html_table(); + $t->caption = get_string('attemptheading', 'assign', $attemptsummaryparams); + $t->captionhide = true; // Hidden because it matches the title above. if ($submission) { $cell1content = get_string('submissionstatus', 'assign');