Permalink
Browse files

Merge branch 'MDL-30955_forum_ratings_21' of git://github.com/andyjda…

…vis/moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents a38d62e + 211bb24 commit 6535721cebaec187dfc968eecfe2bfc528aeb686 Sam Hemelryk committed Apr 15, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 rating/index.php
View
@@ -102,8 +102,10 @@
$table->colclasses = array('', 'firstname', 'rating', 'time');
$table->data = array();
- //if the scale was changed after ratings were submitted some ratings may have a value above the current maximum
- $maxrating = count($scalemenu) - 1;
+ // If the scale was changed after ratings were submitted some ratings may have a value above the current maximum
+ // We can't just do count($scalemenu) - 1 as custom scales start at index 1, not 0
+ $maxrating = max(array_keys($scalemenu));
+
foreach ($ratings as $rating) {
//Undo the aliasing of the user id column from user_picture::fields()
//we could clone the rating object or preserve the rating id if we needed it again

0 comments on commit 6535721

Please sign in to comment.