From 07adad05aa62131a8d786b7914271626c56da8d2 Mon Sep 17 00:00:00 2001 From: Michael de Raadt Date: Thu, 18 Aug 2016 20:22:37 +1000 Subject: [PATCH] CONTRIB-6490 block_completion_progress: Add alt attribute to tick-cross icon in details section --- lib.php | 12 +++++++++--- version.php | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib.php b/lib.php index 6ca84a8..8421749 100644 --- a/lib.php +++ b/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++; } } diff --git a/version.php b/version.php index 22f14ef..5de189c 100644 --- a/version.php +++ b/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';