Skip to content

Commit 3c13b4f

Browse files
committed
Plugin: ExerciseFocused: Round number of random results - refs BT#21074
1 parent ea78b6c commit 3c13b4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/exercisefocused/src/Traits/ReportingFilterTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,9 @@ private function pickRandomAttempts(array $attemptIdList): array
378378
}
379379

380380
$percentage = count($attemptIdList) * ($settingPercentage / 100);
381+
$round = round($percentage) ?: 1;
381382

382-
$random = (array) array_rand($attemptIdList, ceil($percentage));
383+
$random = (array) array_rand($attemptIdList, $round);
383384

384385
$selection = [];
385386

0 commit comments

Comments
 (0)