mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-30955 rating: corrected /rating/index.php as it was determining the maximum rating incorrectly for custom scales
This commit is contained in:
parent
9ad535c550
commit
08f06b1c24
@ -102,8 +102,10 @@ if (!$ratings) {
|
||||
$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
|
||||
|
Loading…
x
Reference in New Issue
Block a user