Skip to content

Commit

Permalink
rating MDL-26274 made rating_ajax.php use the current scale rather th…
Browse files Browse the repository at this point in the history
…an the scale from the users previously submitted rating
  • Loading branch information
andyjdavis committed Feb 11, 2011
1 parent d911c72 commit 66cb20f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rating/rate_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 66cb20f

Please sign in to comment.