diff --git a/app/model/view/GroupViewFactory.php b/app/model/view/GroupViewFactory.php index ed72b5b9..6acd99ed 100644 --- a/app/model/view/GroupViewFactory.php +++ b/app/model/view/GroupViewFactory.php @@ -159,17 +159,21 @@ private function getStudentStatsInternal( } $passesLimit = null; // null = no limit + $limit = null; if ($group->getPointsLimit() !== null && $group->getPointsLimit() > 0) { - $passesLimit = $gainedPoints >= $group->getPointsLimit(); + $limit = $group->getPointsLimit(); + $passesLimit = $gainedPoints >= $limit; } elseif ($group->getThreshold() !== null && $group->getThreshold() > 0) { - $passesLimit = $gainedPoints >= $maxPoints * $group->getThreshold(); + $limit = $maxPoints * $group->getThreshold(); + $passesLimit = $gainedPoints >= $limit; } return [ "userId" => $student->getId(), "groupId" => $group->getId(), "points" => [ "total" => $maxPoints, - "gained" => $gainedPoints + "limit" => $limit, + "gained" => $gainedPoints, ], "hasLimit" => $passesLimit !== null, "passesLimit" => $passesLimit ?? true,