rating MDL-26461 fixed an off by 1 bug that made the safeguard against too high ratings not work

This commit is contained in:
Andrew Davis (andyjdavis)
2011-02-21 10:48:38 +08:00
parent d20b9662fc
commit aafa4f324a
+2 -1
View File
@@ -92,7 +92,8 @@ if (!$ratings) {
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