From 40e0baf08efa203ca70fae630dae8d2136c65243 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 7bf4b842555a1..8533e2d5e3677 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -1590,7 +1590,6 @@ public function display_grade($grade, $editing, $userid=0, $modified=0) { static $scalegrades = array(); - $decimals = $this->get_grade_item()->get_decimals(); $o = ''; if ($this->get_instance()->grade >= 0) { @@ -1599,7 +1598,7 @@ public function display_grade($grade, $editing, $userid=0, $modified=0) { if ($grade < 0) { $displaygrade = ''; } else { - $displaygrade = format_float($grade, $decimals); + $displaygrade = format_float($grade, $this->get_grade_item()->get_decimals()); } $o .= '