Skip to content
Browse files

Merge branch 'MDL-26274_rating_delete' of git://github.com/andyjdavis…

…/moodle
  • Loading branch information...
2 parents 2e6bd88 + 66cb20f commit 378906a2730e3c24c8e875b7d0ee0a7ae4f2b57c @stronk7 stronk7 committed Feb 14, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 rating/rate_ajax.php
View
4 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];

0 comments on commit 378906a

Please sign in to comment.
Something went wrong with that request. Please try again.