Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gradebook MDL-16103 prevented outcomes in gradebook showing the same …

…icon as the activity they are attached to as it makes them hard to find.
  • Loading branch information...
commit 0077f57198991e601b647239d2300be3d3eafde3 1 parent e76e431
Andrew Davis authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 grade/lib.php
View
14 grade/lib.php
@@ -1013,6 +1013,7 @@ public function get_element_icon(&$element, $spacerifnone=false) {
$is_category = $element['object']->is_category_item();
$is_scale = $element['object']->gradetype == GRADE_TYPE_SCALE;
$is_value = $element['object']->gradetype == GRADE_TYPE_VALUE;
+ $is_outcome = !empty($element['object']->outcomeid);
if ($element['object']->is_calculated()) {
$strcalc = get_string('calculatedgrade', 'grades');
@@ -1038,12 +1039,19 @@ public function get_element_icon(&$element, $spacerifnone=false) {
}
} else if ($element['object']->itemtype == 'mod') {
- $strmodname = get_string('modulename', $element['object']->itemmodule);
- return '<img src="'.$OUTPUT->pix_url('icon',
+ //prevent outcomes being displaying the same icon as the activity they are attached to
+ if ($is_outcome) {
+ $stroutcome = s(get_string('outcome', 'grades'));
+ return '<img src="'.$OUTPUT->pix_url('i/outcomes') . '" ' .
+ 'class="icon itemicon" title="'.$stroutcome.
+ '" alt="'.$stroutcome.'"/>';
+ } else {
+ $strmodname = get_string('modulename', $element['object']->itemmodule);
+ return '<img src="'.$OUTPUT->pix_url('icon',
$element['object']->itemmodule) . '" ' .
'class="icon itemicon" title="' .s($strmodname).
'" alt="' .s($strmodname).'"/>';
-
+ }
} else if ($element['object']->itemtype == 'manual') {
if ($element['object']->is_outcome_item()) {
$stroutcome = get_string('outcome', 'grades');
Please sign in to comment.
Something went wrong with that request. Please try again.