Skip to content

Commit

Permalink
MDL-51932 workshop: Improve UX for teachers on switching workshop phases
Browse files Browse the repository at this point in the history
The icon itself has been found insufficient, teachers did not realize it
was used to switch the phase. Its semantics is even less intuitive in
Boost when we do not show it on course outline any more.

So this patch starts to display the information that has been present
for assistive technologies only. As a side effect, I spotted there was a
bug that caused the id attribute "mod_workshop-userplancurrenttasks"
was used for all titles (not only the current one) so it did not
really serve the purpose well.
  • Loading branch information
mudrd8mz committed Apr 18, 2017
1 parent 6d14355 commit b45193c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
6 changes: 6 additions & 0 deletions mod/workshop/lang/en/workshop.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,18 @@
$string['subplugintype_workshopform_plural'] = 'Grading strategies';
$string['switchingphase'] = 'Switching phase';
$string['switchphase'] = 'Switch phase';
$string['switchphaseauto'] = 'Switching has been scheduled';
$string['switchphasenext'] = 'Switch to the next phase';
$string['switchphase10'] = 'Switch to the setup phase';
$string['switchphase10info'] = 'You are about to switch the workshop into the <strong>Setup phase</strong>. In this phase, users cannot modify their submissions or their assessments. Teachers may use this phase to change workshop settings, modify the grading strategy or tweak assessment forms.';
$string['switchphase20'] = 'Switch to the submission phase';
$string['switchphase20info'] = 'You are about to switch the workshop into the <strong>Submission phase</strong>. Students may submit their work during this phase (within the submission access control dates, if set). Teachers may allocate submissions for peer review.';
$string['switchphase30'] = 'Switch to the assessment phase';
$string['switchphase30auto'] = 'Workshop will automatically switch into the assessment phase after {$a->daydatetime} ({$a->distanceday})';
$string['switchphase30info'] = 'You are about to switch the workshop into the <strong>Assessment phase</strong>. In this phase, reviewers may assess the submissions they have been allocated (within the assessment access control dates, if set).';
$string['switchphase40'] = 'Switch to the evaluation phase';
$string['switchphase40info'] = 'You are about to switch the workshop into the <strong>Grading evaluation phase</strong>. In this phase, users cannot modify their submissions or their assessments. Teachers may use the grading evaluation tools to calculate final grades and provide feedback for reviewers.';
$string['switchphase50'] = 'Close workshop';
$string['switchphase50info'] = 'You are about to close the workshop. This will result in the calculated grades appearing in the gradebook. Students may view their submissions and their submission assessments.';
$string['taskassesspeers'] = 'Assess peers';
$string['taskassesspeersdetails'] = 'total: {$a->total}<br />pending: {$a->todo}';
Expand Down
35 changes: 20 additions & 15 deletions mod/workshop/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,31 +295,36 @@ protected function render_workshop_user_plan(workshop_user_plan $plan) {
foreach ($plan->phases as $phasecode => $phase) {
$o .= html_writer::start_tag('dl', array('class' => 'phase'));
$actions = '';
foreach ($phase->actions as $action) {
switch ($action->type) {
case 'switchphase':
$icon = 'i/marker';
if ($phasecode == workshop::PHASE_ASSESSMENT
and $plan->workshop->phase == workshop::PHASE_SUBMISSION
and $plan->workshop->phaseswitchassessment) {
$icon = 'i/scheduled';

if ($phase->active) {
// Mark the section as the current one.
$icon = $this->output->pix_icon('i/marked', '', 'moodle', ['role' => 'presentation']);
$actions .= get_string('userplancurrentphase', 'workshop').' '.$icon;

} else {
// Display a control widget to switch to the given phase or mark the phase as the current one.
foreach ($phase->actions as $action) {
if ($action->type === 'switchphase') {
if ($phasecode == workshop::PHASE_ASSESSMENT && $plan->workshop->phase == workshop::PHASE_SUBMISSION
&& $plan->workshop->phaseswitchassessment) {
$icon = new pix_icon('i/scheduled', get_string('switchphaseauto', 'mod_workshop'));
} else {
$icon = new pix_icon('i/marker', get_string('switchphase'.$phasecode, 'mod_workshop'));
}
$actions .= $this->output->action_icon($action->url,
new pix_icon($icon, get_string('switchphase', 'workshop')));
break;
$actions .= $this->output->action_icon($action->url, $icon, null, null, true);
}
}
}

if (!empty($actions)) {
$actions = $this->output->container($actions, 'actions');
}
$title = html_writer::span($phase->title, '', array('id' => 'mod_workshop-userplancurrenttasks'));
if ($phase->active) {
$title .= ' ' . html_writer::span(get_string('userplancurrentphase', 'workshop'), 'accesshide');
}
$classes = 'phase' . $phasecode;
if ($phase->active) {
$title = html_writer::span($phase->title, 'phasetitle', ['id' => 'mod_workshop-userplancurrenttasks']);
$classes .= ' active';
} else {
$title = html_writer::span($phase->title, 'phasetitle');
$classes .= ' nonactive';
}
$o .= html_writer::start_tag('dt', array('class' => $classes));
Expand Down
7 changes: 5 additions & 2 deletions mod/workshop/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,16 @@
.path-mod-workshop .userplan dt.active {
vertical-align: top;
color: black;
font-size: 140%;
border: 1px solid #ddd;
border-bottom: 0;
border-top: 0;
background: #e7f1c3;
}

.path-mod-workshop .userplan dt.active .phasetitle {
font-size: 140%;
}

.path-mod-workshop .userplan dl {
width: 20%;
float: left;
Expand Down Expand Up @@ -355,7 +358,7 @@
}

.path-mod-workshop .userplan dt .actions {
display: inline;
font-size: smaller;
}

.path-mod-workshop .userplan dd.phasetasks li {
Expand Down

0 comments on commit b45193c

Please sign in to comment.