Browse Source

CONTRIB-6490 block_completion_progress: Add alt attribute to tick-cross icon in details section

master 2016081800
Michael de Raadt 9 years ago
parent
commit
07adad05aa
  1. 12
      lib.php
  2. 2
      version.php

12
lib.php

@ -546,23 +546,29 @@ function block_completion_progress_bar($activities, $completions, $config, $user
$content .= $text;
}
$content .= HTML_WRITER::empty_tag('br');
$altattribute = '';
if ($completed == COMPLETION_COMPLETE) {
$content .= $stringcomplete.' ';
$icon = 'tick';
$altattribute = $stringcomplete;
} else if ($completed == COMPLETION_COMPLETE_PASS) {
$content .= $stringpassed.' ';
$icon = 'tick';
$altattribute = $stringpassed;
} else if ($completed == COMPLETION_COMPLETE_FAIL) {
$content .= $stringfailed.' ';
$icon = 'cross';
$altattribute = $stringfailed;
} else {
$content .= $stringincomplete .' ';
$icon = 'cross';
$altattribute = $stringincomplete;
if ($completed === 'submitted') {
$content .= '(' . $stringsubmitted . ') ';
$altattribute .= '(' . $stringsubmitted . ')';
}
}
$content .= $OUTPUT->pix_icon($icon, '', 'block_completion_progress', array('class' => 'iconInInfo'));
$content .= $OUTPUT->pix_icon($icon, $altattribute, 'block_completion_progress', array('class' => 'iconInInfo'));
$content .= HTML_WRITER::empty_tag('br');
if ($activity['expected'] != 0) {
$content .= HTML_WRITER::start_tag('div', array('class' => 'expectedBy'));
@ -589,8 +595,8 @@ function block_completion_progress_percentage($activities, $completions) {
foreach ($activities as $activity) {
if (
$completions[$activity['id']] == COMPLETION_COMPLETE ||
$completions[$activity['id']] == COMPLETION_COMPLETE_PASS)
{
$completions[$activity['id']] == COMPLETION_COMPLETE_PASS
) {
$completecount++;
}
}

2
version.php

@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2016061800;
$plugin->version = 2016081800;
$plugin->requires = 2014051200; // Moodle 2.7.
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'Version for Moodle 2.7 onwards';

Loading…
Cancel
Save