Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

rating MDL-26274 made rating_ajax.php use the current scale rather th…

…an the scale from the users previously submitted rating
  • Loading branch information...
commit 66cb20f6c0c945d1f36ee8363d5dcf816a7c8fda 1 parent d911c72
Andrew Davis andyjdavis authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 rating/rate_ajax.php
4 rating/rate_ajax.php
@@ -141,10 +141,10 @@
141 141 // Output a dash if aggregation method == COUNT as the count is output next to the aggregate anyway
142 142 if ($items[0]->rating->settings->aggregationmethod==RATING_AGGREGATE_COUNT or $items[0]->rating->count == 0) {
143 143 $aggregatetoreturn = ' - ';
144   -} else if($rating->scaleid < 0) { //if its non-numeric scale
  144 +} else if($items[0]->rating->settings->scale->id < 0) { //if its non-numeric scale
145 145 //dont use the scale item if the aggregation method is sum as adding items from a custom scale makes no sense
146 146 if ($items[0]->rating->settings->aggregationmethod!= RATING_AGGREGATE_SUM) {
147   - $scalerecord = $DB->get_record('scale', array('id' => -$rating->scaleid));
  147 + $scalerecord = $DB->get_record('scale', array('id' => -$items[0]->rating->settings->scale->id));
148 148 if ($scalerecord) {
149 149 $scalearray = explode(',', $scalerecord->scale);
150 150 $aggregatetoreturn = $scalearray[$aggregatetoreturn-1];

0 comments on commit 66cb20f

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