From ddc9cff68b5efa97e9949cf7ecefd6b400b60559 Mon Sep 17 00:00:00 2001 From: Loc Nguyen Date: Wed, 22 Jun 2016 11:47:28 +0700 Subject: [PATCH] MDL-54934 workshop: indicate current phase Indicate phase in page titles, current phase in userplan table so that it's accessible to me through my screen reader --- mod/workshop/lang/en/workshop.php | 1 + mod/workshop/renderer.php | 4 ++++ mod/workshop/submission.php | 1 + mod/workshop/view.php | 12 ++++++++++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mod/workshop/lang/en/workshop.php b/mod/workshop/lang/en/workshop.php index 4b1ff73acee..3815417cc4d 100644 --- a/mod/workshop/lang/en/workshop.php +++ b/mod/workshop/lang/en/workshop.php @@ -320,6 +320,7 @@ $string['usepeerassessment_help'] = 'If enabled, a user may be allocated submiss $string['userdatecreated'] = 'submitted on {$a}'; $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['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 91ac7faeb48..ea5194113e1 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -289,6 +289,10 @@ class mod_workshop_renderer extends plugin_renderer_base { $row->attributes['class'] = 'phasetasks'; foreach ($plan->phases as $phasecode => $phase) { $title = html_writer::tag('span', $phase->title); + if ($phase->active) { + $title .= html_writer::tag('span', get_string('userplancurrentphase', 'workshop'), + array('class' => 'accesshide')); + } $actions = ''; foreach ($phase->actions as $action) { switch ($action->type) { diff --git a/mod/workshop/submission.php b/mod/workshop/submission.php index d4326649ab1..3d7e1fb42e9 100644 --- a/mod/workshop/submission.php +++ b/mod/workshop/submission.php @@ -316,6 +316,7 @@ if ($edit) { $output = $PAGE->get_renderer('mod_workshop'); echo $output->header(); echo $output->heading(format_string($workshop->name), 2); +echo $output->heading(get_string('mysubmission', 'workshop'), 3); // show instructions for submitting as thay may contain some list of questions and we need to know them // while reading the submitted answer diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 094b5b22168..771d007ddfd 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -84,7 +84,15 @@ if (!is_null($editmode) && $PAGE->user_allowed_editing()) { $USER->editing = $editmode; } -$PAGE->set_title($workshop->name); +$userplan = new workshop_user_plan($workshop, $USER->id); + +foreach ($userplan->phases as $phase) { + if ($phase->active) { + $currentphasetitle = $phase->title; + } +} + +$PAGE->set_title($workshop->name . " (" . $currentphasetitle . ")"); $PAGE->set_heading($course->fullname); if ($perpage and $perpage > 0 and $perpage <= 1000) { @@ -101,12 +109,12 @@ if ($eval) { } $output = $PAGE->get_renderer('mod_workshop'); -$userplan = new workshop_user_plan($workshop, $USER->id); /// Output starts here echo $output->header(); echo $output->heading_with_help(format_string($workshop->name), 'userplan', 'workshop'); +echo $output->heading(format_string($currentphasetitle), 3); echo $output->render($userplan); switch ($workshop->phase) {