Skip to content

Commit

Permalink
rating MDL-21657 put default scale in a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Davis committed Mar 18, 2010
1 parent bab7e00 commit 786f3cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rating/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
define ('RATING_AGGREGATE_MINIMUM', 4);
define ('RATING_AGGREGATE_SUM', 5);

define ('RATING_SCALE_OUT_OF_5', 5);

/**
* The rating class represents a single rating by a single user. It also contains a static method to retrieve sets of ratings.
*
Expand Down Expand Up @@ -205,7 +207,7 @@ public static function load_ratings_for_item($context, $itemid, $sort) {
* @param string $returnurl the url to return the user to after submitting a rating. Can be left null for ajax requests.
* @return array the array of items with their ratings attached at $items[0]->rating
*/
public static function load_ratings($context, $items, $aggregate=RATING_AGGREGATE_AVERAGE, $scaleid=5, $userid = null, $returnurl = null) {
public static function load_ratings($context, $items, $aggregate=RATING_AGGREGATE_AVERAGE, $scaleid=RATING_SCALE_OUT_OF_5, $userid = null, $returnurl = null) {
global $DB, $USER, $PAGE, $CFG;

if(empty($items)) {
Expand Down

0 comments on commit 786f3cc

Please sign in to comment.