Browse files

rating MDL-26461 fixed an off by 1 bug that made the safeguard agains…

…t too high ratings not work
  • Loading branch information...
1 parent d20b966 commit aafa4f324a4880c26001ab745ee06b32ee57cb31 @andyjdavis andyjdavis committed Feb 21, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 rating/index.php
@@ -92,7 +92,8 @@
echo "<th class=\"header\" scope=\"col\"><a href=\"index.php?$sortargs&amp;sort=time\">$strtime</a></th>";
echo "</tr>";
- $maxrating = count($scalemenu);
+ //if the scale was changed after ratings were submitted some ratings may have a value above the current maximum
+ $maxrating = count($scalemenu) - 1;
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 aafa4f3

Please sign in to comment.