diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 3c22efae7cd0a..8c63177419caa 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3523,7 +3523,7 @@ function forum_rating_validate($params) { if ($context->id != $params['context']->id) { throw new rating_exception('invalidcontext'); } - + if ($forum->scale != $params['scaleid']) { //the scale being submitted doesnt match the one in the database throw new rating_exception('invalidscaleid'); @@ -3535,7 +3535,7 @@ function forum_rating_validate($params) { throw new rating_exception('notavailable'); } } - + //check that the submitted rating is valid for the scale // lower limit diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index a62dc72ba7f87..e1cb20e4d583e 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -527,7 +527,7 @@ function glossary_rating_validate($params) { //item doesn't exist throw new rating_exception('invaliditemid'); } - + if ($info->scale != $params['scaleid']) { //the scale being submitted doesnt match the one in the database throw new rating_exception('invalidscaleid'); diff --git a/rating/index.php b/rating/index.php index bdf3994ccdc69..38c2f5c5df9be 100644 --- a/rating/index.php +++ b/rating/index.php @@ -88,7 +88,7 @@ if ($popup) { $sorturl->param('popup', $popup); } - + $table = new html_table; $table->cellpadding = 3; $table->cellspacing = 3; @@ -130,4 +130,4 @@ if ($popup) { echo $OUTPUT->close_window_button(); } -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer(); diff --git a/rating/lib.php b/rating/lib.php index 9cad2ca43964c..f1a511e6ec305 100644 --- a/rating/lib.php +++ b/rating/lib.php @@ -571,10 +571,10 @@ public function get_ratings($options) { $aggregatestr(r.rating) AS aggrrating, COUNT(r.rating) AS numratings, ur.id, ur.userid, ur.scaleid, ur.rating AS usersrating FROM {rating} r - LEFT JOIN {rating} ur ON ur.contextid = r.contextid AND - ur.itemid = r.itemid AND - ur.component = r.component AND - ur.ratingarea = r.ratingarea AND + LEFT JOIN {rating} ur ON ur.contextid = r.contextid AND + ur.itemid = r.itemid AND + ur.component = r.component AND + ur.ratingarea = r.ratingarea AND ur.userid = :userid WHERE r.contextid = :contextid AND r.itemid {$itemidtest} AND