Skip to content

Commit

Permalink
MDL-49281 grades: Calculation settings upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Mastny committed Apr 30, 2015
1 parent ee05689 commit 986ee9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions grade/edit/tree/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ public function build_html_tree($element, $totals, $parents, $level, &$row_count
if (!$is_category_item && ($icon = $this->gtree->get_edit_icon($element, $this->gpr, true))) {
$actionsmenu->add($icon);
}

if ($this->show_calculations && ($icon = $this->gtree->get_calculation_icon($element, $this->gpr, true))) {
// MDL-49281 if grade_item already has calculation, it should be editable even if global setting is off.
$type = $element['type'];
$iscalculated = ($type == 'item' or $type == 'courseitem' or $type == 'categoryitem') && $object->is_calculated();
$icon = $this->gtree->get_calculation_icon($element, $this->gpr, true);
if ($iscalculated || ($this->show_calculations && $icon)) {
$actionsmenu->add($icon);
}

Expand Down

0 comments on commit 986ee9f

Please sign in to comment.