From 499fbf48e30021f67ccde7195489053c48bc997d Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Fri, 28 Oct 2016 17:19:09 +0100 Subject: [PATCH] MDL-56948 mod_assign: Don't call get_grade_item() unless we have one --- mod/assign/locallib.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index c2ab71857f4..bfe46e9b3f3 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -1371,7 +1371,6 @@ class assign { static $scalegrades = array(); - $decimals = $this->get_grade_item()->get_decimals(); $o = ''; if ($this->get_instance()->grade >= 0) { @@ -1380,7 +1379,7 @@ class assign { if ($grade < 0) { $displaygrade = ''; } else { - $displaygrade = format_float($grade, $decimals); + $displaygrade = format_float($grade, $this->get_grade_item()->get_decimals()); } $o .= '