From 95d6df779c8edcec43bdebeeca55d1a607922ef8 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 12 Jul 2007 17:46:38 +0000 Subject: [PATCH] MDL-10364 calcualtion icon fix --- grade/report/grader/grader_report.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/grade/report/grader/grader_report.php b/grade/report/grader/grader_report.php index b6c678e336..6936526690 100644 --- a/grade/report/grader/grader_report.php +++ b/grade/report/grader/grader_report.php @@ -1000,9 +1000,15 @@ class grade_report_grader { . 'class="iconsmall" alt="' . $stredit.'" title="'.$stredit.'" />'. "\n"; - $edit_calculation_icon = '' - . ''
-                               . $streditcalculation.''. "\n"; + $edit_calculation_icon = ''; + if ($type == 'item' or $type == 'courseitem' or $type == 'categoryitem') { + // show calculation icon only when calculation possible + if (!$object->is_normal_item() and ($object->gradetype == GRADE_TYPE_SCALE or $object->gradetype == GRADE_TYPE_VALUE)) { + $edit_calculation_icon = '' + . ''
+                                       . $streditcalculation.''. "\n"; + } + } // Prepare Hide/Show icon state $hide_show = 'hide'; @@ -1072,7 +1078,7 @@ class grade_report_grader { } // Calculation icon for items and categories - if ($this->get_user_pref('showcalculations') && $type != 'grade') { + if ($this->get_user_pref('showcalculations')) { $html .= $edit_calculation_icon; } -- 2.39.5