File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -639,7 +639,7 @@ function moodleoverflow_can_create_attachment($moodleoverflow, $context) {
639639}
640640
641641/**
642- * Obtain grades from plugin's database tab
642+ * Get the grades of a moodleoverflow instance for all users or a single user.
643643 *
644644 * @param stdClass $moodleoverflow moodleoverflow object
645645 * @param int $userid optional userid, 0 means all users.
@@ -652,8 +652,9 @@ function moodleoverflow_get_user_grades($moodleoverflow, $userid = 0) {
652652 $ params = ["moodleoverflowid " => $ moodleoverflow ->id ];
653653
654654 $ sql = "SELECT u.id AS userid, g.grade AS rawgrade
655- FROM {user} u, {moodleoverflow_grades} g
656- WHERE u.id = g.userid AND g.moodleoverflowid = :moodleoverflowid " ;
655+ FROM {user} u
656+ JOIN {moodleoverflow_grades} g ON u.id = g.userid
657+ WHERE g.moodleoverflowid = :moodleoverflowid " ;
657658
658659 if ($ userid ) {
659660 $ sql .= ' AND u.id = :userid ' ;
You can’t perform that action at this time.
0 commit comments