From d54b4cdfa182804f58687b4f4087756921dda326 Mon Sep 17 00:00:00 2001 From: Loc Nguyen Date: Mon, 13 Jun 2016 14:18:50 +0700 Subject: [PATCH] MDL-54832 workshop: adding landmark for userplantable Accessibility enhance: add an aria-label on the userplan table so that it's accessible to me through my screen reader --- mod/workshop/lang/en/workshop.php | 1 + mod/workshop/renderer.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mod/workshop/lang/en/workshop.php b/mod/workshop/lang/en/workshop.php index 4b1ff73acee..10864ffd0f3 100644 --- a/mod/workshop/lang/en/workshop.php +++ b/mod/workshop/lang/en/workshop.php @@ -321,6 +321,7 @@ $string['userdatecreated'] = 'submitted on {$a}'; $string['userdatemodified'] = 'modified on {$a}'; $string['userplan'] = 'Workshop planner'; $string['userplan_help'] = 'The workshop planner displays all phases of the activity and lists the tasks for each phase. The current phase is highlighted and task completion is indicated with a tick.'; +$string['userplanaccessibilitytitle'] = 'Workshop timeline with {$a} phases'; $string['useselfassessment'] = 'Use self-assessment'; $string['useselfassessment_help'] = 'If enabled, a user may be allocated their own submission to assess and will receive a grade for assessment in addition to a grade for their submission.'; $string['useselfassessment_desc'] = 'Students may assess their own work'; diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index 91ac7faeb48..6519fda8b4c 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -283,6 +283,9 @@ class mod_workshop_renderer extends plugin_renderer_base { protected function render_workshop_user_plan(workshop_user_plan $plan) { $table = new html_table(); $table->attributes['class'] = 'userplan'; + $table->attributes['role'] = 'section'; + $numberofphases = count($plan->phases); + $table->attributes['aria-label'] = get_string('userplanaccessibilitytitle', 'workshop', $numberofphases); $table->head = array(); $table->colclasses = array(); $row = new html_table_row();