diff --git a/Modules/Test/classes/class.ilTestEvaluationUserData.php b/Modules/Test/classes/class.ilTestEvaluationUserData.php index f2c968482d2d..04ae024b09cc 100755 --- a/Modules/Test/classes/class.ilTestEvaluationUserData.php +++ b/Modules/Test/classes/class.ilTestEvaluationUserData.php @@ -383,15 +383,17 @@ public function getReachedPoints(int $pass = 0): float public function getAvailablePoints(int $pass = 0): float { - $available = 0; - if (!is_object($this->passes[$pass])) { + if (!isset($this->passes[$pass])) { $pass = 0; } - if (!is_object($this->passes[$pass])) { + + if (!isset($this->passes[$pass])) { return 0; } + $available = $this->passes[$pass]->getMaxPoints(); $available = round($available, 2); + return $available; }