Skip to content
Snippets Groups Projects
Commit 80da8c24 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

use correct column for progress calculation, fixes #2281

Closes #2281

Merge request studip/studip!1505
parent e71fa2a3
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -95,10 +95,10 @@ class UserProgressesOfUnitsShow extends NonJsonApiController
}
private function getSelfProgresses(
array &$allBlockIds,
array $allBlockIds,
string $elementId,
array &$userProgresses,
array &$courseMemberIds
array $userProgresses,
array $courseMemberIds
): array {
$blks = $allBlockIds[$elementId] ?? [];
if (count($blks) === 0) {
......@@ -116,7 +116,7 @@ class UserProgressesOfUnitsShow extends NonJsonApiController
$usersCounter = count($courseMemberIds);
foreach ($blks as $blk) {
$progresses = $userProgresses[$blk];
$usersProgress = $progresses['count'] ? (float) $progresses['sum'] : 0;
$usersProgress = $progresses['count'] ? (float) $progresses['grade'] : 0;
$data['progress'] += $usersProgress / $usersCounter;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment