Skip to content

Commit

Permalink
MDL-54934 workshop: indicate current phase
Browse files Browse the repository at this point in the history
Indicate phase in page titles, current phase in userplan table
so that it's accessible to me through my screen reader
  • Loading branch information
Loc Nguyen committed Jul 1, 2016
1 parent 6513308 commit e1f1485
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions mod/workshop/lang/en/workshop.php
Expand Up @@ -320,6 +320,7 @@
$string['userdatecreated'] = 'submitted on <span>{$a}</span>';
$string['userdatemodified'] = 'modified on <span>{$a}</span>';
$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.';
Expand Down
4 changes: 4 additions & 0 deletions mod/workshop/renderer.php
Expand Up @@ -289,6 +289,10 @@ protected function render_workshop_user_plan(workshop_user_plan $plan) {
$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) {
Expand Down
1 change: 1 addition & 0 deletions mod/workshop/submission.php
Expand Up @@ -316,6 +316,7 @@
$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
Expand Down
12 changes: 10 additions & 2 deletions mod/workshop/view.php
Expand Up @@ -84,7 +84,15 @@
$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) {
Expand All @@ -101,12 +109,12 @@
}

$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) {
Expand Down

0 comments on commit e1f1485

Please sign in to comment.