@@ -121,9 +121,7 @@ public static function moodleoverflow_add_rating($moodleoverflow, $postid, $rati
121
121
}
122
122
123
123
// Delete the rating.
124
- self ::moodleoverflow_remove_rating ($ postid , $ rating / 10 , $ userid , $ modulecontext );
125
-
126
- return true ;
124
+ return self ::moodleoverflow_remove_rating ($ postid , $ rating / 10 , $ userid , $ modulecontext );
127
125
}
128
126
129
127
// Check for an older rating in this discussion.
@@ -641,8 +639,8 @@ private static function moodleoverflow_check_old_rating($postid, $userid, $oldra
641
639
// Get the solved rating.
642
640
$ sql = "SELECT *
643
641
FROM {moodleoverflow_ratings}
644
- WHERE userid = ? AND postid = ? AND rating = 3 " ;
645
- $ rating ['solved ' ] = $ DB ->get_record_sql ($ sql , [ $ userid , $ postid ]);
642
+ WHERE postid = ? AND rating = 3 " ;
643
+ $ rating ['solved ' ] = $ DB ->get_record_sql ($ sql , [ $ postid ]);
646
644
647
645
// Return the rating if it is requested.
648
646
if ($ oldrating == RATING_SOLVED ) {
@@ -652,8 +650,8 @@ private static function moodleoverflow_check_old_rating($postid, $userid, $oldra
652
650
// Get the helpful rating.
653
651
$ sql = "SELECT *
654
652
FROM {moodleoverflow_ratings}
655
- WHERE userid = ? AND postid = ? AND rating = 4 " ;
656
- $ rating ['helpful ' ] = $ DB ->get_record_sql ($ sql , [ $ userid , $ postid ]);
653
+ WHERE postid = ? AND rating = 4 " ;
654
+ $ rating ['helpful ' ] = $ DB ->get_record_sql ($ sql , [ $ postid ]);
657
655
658
656
// Return the rating if it is requested.
659
657
if ($ oldrating == RATING_HELPFUL ) {
0 commit comments