From e74f4aced7940825eace51334522b7d491fa569b Mon Sep 17 00:00:00 2001 From: Willian Mano Date: Fri, 15 May 2015 16:03:56 -0300 Subject: [PATCH] Resolvido bug de alunos em mais de um curso --- lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib.php b/lib.php index d1a745a..692c13b 100755 --- a/lib.php +++ b/lib.php @@ -54,7 +54,7 @@ function block_ranking_get_students($limit = null) { FROM {user} u INNER JOIN {role_assignments} a ON a.userid = u.id - INNER JOIN {ranking_points} r ON r.userid = u.id + INNER JOIN {ranking_points} r ON r.userid = u.id AND r.courseid = :r_courseid INNER JOIN {context} c ON c.id = a.contextid WHERE a.contextid = :contextid AND a.userid = u.id @@ -67,6 +67,7 @@ function block_ranking_get_students($limit = null) { $params['roleid'] = 5; $params['courseid'] = $COURSE->id; $params['crsid'] = $COURSE->id; + $params['r_courseid'] = $COURSE->id; $users = array_values($DB->get_records_sql($sql, $params));