diff --git a/mod/workshop/lang/en/workshop.php b/mod/workshop/lang/en/workshop.php index 43a34f4479b..c7bea5ef07a 100644 --- a/mod/workshop/lang/en/workshop.php +++ b/mod/workshop/lang/en/workshop.php @@ -329,6 +329,7 @@ $string['userdatemodified'] = 'modified on {$a}'; $string['userplan'] = 'Workshop planner'; $string['userplancurrentphase'] = 'Current phase'; $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['userplanaccessibilityskip'] = 'Skip to current tasks'; $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.'; diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index e096c9841c7..fd16b4ab64e 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -283,8 +283,14 @@ class mod_workshop_renderer extends plugin_renderer_base { protected function render_workshop_user_plan(workshop_user_plan $plan) { $o = ''; // Output HTML code. $numberofphases = count($plan->phases); - $o .= html_writer::start_tag('div', array('class' => 'userplan')); - $o .= html_writer::tag('span', get_string('userplanaccessibilitytitle', 'workshop', $numberofphases), + $o .= html_writer::start_tag('div', array( + 'class' => 'userplan', + 'aria-labelledby' => 'mod_workshop-userplanheading', + 'aria-describedby' => 'mod_workshop-userplanaccessibilitytitle', + )); + $o .= html_writer::span(get_string('userplanaccessibilitytitle', 'workshop', $numberofphases), + 'accesshide', array('id' => 'mod_workshop-userplanaccessibilitytitle')); + $o .= html_writer::link('#mod_workshop-userplancurrenttasks', get_string('userplanaccessibilityskip', 'workshop'), array('class' => 'accesshide')); foreach ($plan->phases as $phasecode => $phase) { $o .= html_writer::start_tag('dl', array('class' => 'phase')); @@ -306,10 +312,9 @@ class mod_workshop_renderer extends plugin_renderer_base { if (!empty($actions)) { $actions = $this->output->container($actions, 'actions'); } - $title = html_writer::tag('span', $phase->title); + $title = html_writer::span($phase->title, '', array('id' => 'mod_workshop-userplancurrenttasks')); if ($phase->active) { - $title .= ' ' . html_writer::tag('span', get_string('userplancurrentphase', 'workshop'), - array('class' => 'accesshide')); + $title .= ' ' . html_writer::span(get_string('userplancurrentphase', 'workshop'), 'accesshide'); } $classes = 'phase' . $phasecode; if ($phase->active) { diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 10b6024c604..0acfe36a741 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -114,7 +114,7 @@ $output = $PAGE->get_renderer('mod_workshop'); echo $output->header(); echo $output->heading_with_help(format_string($workshop->name), 'userplan', 'workshop'); -echo $output->heading(format_string($currentphasetitle), 3); +echo $output->heading(format_string($currentphasetitle), 3, null, 'mod_workshop-userplanheading'); echo $output->render($userplan); switch ($workshop->phase) {