From 66cb20f6c0c945d1f36ee8363d5dcf816a7c8fda Mon Sep 17 00:00:00 2001 From: andyjdavis Date: Fri, 11 Feb 2011 15:15:49 +0800 Subject: [PATCH] rating MDL-26274 made rating_ajax.php use the current scale rather than the scale from the users previously submitted rating --- rating/rate_ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rating/rate_ajax.php b/rating/rate_ajax.php index 331529dae285b..a1a2cb704c7bc 100644 --- a/rating/rate_ajax.php +++ b/rating/rate_ajax.php @@ -141,10 +141,10 @@ // Output a dash if aggregation method == COUNT as the count is output next to the aggregate anyway if ($items[0]->rating->settings->aggregationmethod==RATING_AGGREGATE_COUNT or $items[0]->rating->count == 0) { $aggregatetoreturn = ' - '; -} else if($rating->scaleid < 0) { //if its non-numeric scale +} else if($items[0]->rating->settings->scale->id < 0) { //if its non-numeric scale //dont use the scale item if the aggregation method is sum as adding items from a custom scale makes no sense if ($items[0]->rating->settings->aggregationmethod!= RATING_AGGREGATE_SUM) { - $scalerecord = $DB->get_record('scale', array('id' => -$rating->scaleid)); + $scalerecord = $DB->get_record('scale', array('id' => -$items[0]->rating->settings->scale->id)); if ($scalerecord) { $scalearray = explode(',', $scalerecord->scale); $aggregatetoreturn = $scalearray[$aggregatetoreturn-1];