From 2817bc1aed3a7f87711f00499373b1dee4f0d86c Mon Sep 17 00:00:00 2001 From: mark-nielsen Date: Tue, 19 Sep 2006 02:41:10 +0000 Subject: [PATCH] Fixed a bug when detecting a user as eligible for posting their name for high scores --- mod/lesson/view.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 151168d4f3..abbdf6a649 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -943,15 +943,18 @@ $madeit = false; if ($highscores = get_records_select("lesson_high_scores", "lessonid = $lesson->id")) { // get all the high scores into an array + $topscores = array(); + $uniquescores = array(); foreach ($highscores as $highscore) { $grade = $grades[$highscore->gradeid]->grade; $topscores[] = $grade; + $uniquescores[$grade] = 1; } // sort to find the lowest score sort($topscores); $lowscore = $topscores[0]; - if ($gradeinfo->grade >= $lowscore || count($topscores) <= $lesson->maxhighscores) { + if ($gradeinfo->grade >= $lowscore || count($uniquescores) <= $lesson->maxhighscores) { $madeit = true; } } -- 2.39.5