From 8c5c5eaee4e252dab9d053d7a2cd529ee8ccc3db Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 5 Sep 2025 18:59:54 +0800 Subject: [PATCH] MDL-86512 mod_assign: Make the select column header name more accessible --- mod/assign/gradingtable.php | 21 ++++++++++++++++++--- mod/assign/lang/en/assign.php | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mod/assign/gradingtable.php b/mod/assign/gradingtable.php index ab44d08959d..e535dee40bd 100644 --- a/mod/assign/gradingtable.php +++ b/mod/assign/gradingtable.php @@ -378,9 +378,24 @@ class assign_grading_table extends table_sql implements renderable { // Select. if (!$this->is_downloading() && $this->hasgrade) { $columns[] = 'select'; - $headers[] = get_string('select') . - '
-
'; + // The displayed text for the column header. Hidden to assistive technologies. + $visibleheader = html_writer::span(get_string('select'), '', ['aria-hidden' => 'true']); + // The actual accessible name for the column header which provides more context about the column's purpose to + // screen reader users. + $bulkactionsselection = html_writer::span(get_string('bulkactionsselection', 'assign'), 'sr-only'); + + // The select all checkbox. + $selectalllabel = html_writer::label(get_string('selectall'), 'selectall', false, ['class' => 'sr-only']); + $selectallcheckbox = html_writer::empty_tag( + 'input', + [ + 'type' => 'checkbox', + 'id' => 'selectall', + 'name' => 'selectall', + ], + ); + $headers[] = $visibleheader . $bulkactionsselection . + html_writer::div($selectalllabel . $selectallcheckbox, 'selectall'); } if ($this->hasviewblind || !$this->assignment->is_blind_marking()) { diff --git a/mod/assign/lang/en/assign.php b/mod/assign/lang/en/assign.php index ba9dcccddfa..71b6e0f9161 100644 --- a/mod/assign/lang/en/assign.php +++ b/mod/assign/lang/en/assign.php @@ -148,6 +148,7 @@ $string['blindmarking'] = 'Anonymous submissions'; $string['blindmarkingenabledwarning'] = 'Anonymous submissions are enabled for this activity.'; $string['blindmarkingnogradewarning'] = 'Anonymous submissions are enabled for this activity. Grades will not be added to the gradebook until student identities are revealed via the "Actions" menu.'; $string['blindmarking_help'] = 'Anonymous submissions hide the identity of students from markers. Anonymous submission settings will be locked once a submission or grade has been made in relation to this assignment.'; +$string['bulkactionsselection'] = 'Bulk actions selection'; $string['cachedef_overrides'] = 'User and group override information'; $string['calendardue'] = '{$a} is due'; $string['calendarextension'] = '{$a} is due (extension)';