Permalink
Browse files

Merge branch 'MDL-35175_24' of git://github.com/rlorenzo/moodle into …

…MOODLE_24_STABLE
  • Loading branch information...
damyon committed Feb 25, 2013
2 parents 56d22f1 + b20c4d5 commit a083389c63e395f6d5c51e4b064ecab03367886f
Showing with 4 additions and 3 deletions.
  1. +4 −3 mod/lesson/report.php
View
@@ -47,13 +47,14 @@
$params = array_merge($params, $sortparams);
// TODO: Improve this. Fetching all students always is crazy!
if (!empty($cm->groupingid)) {
- $params["groupid"] = $cm->groupingid;
+ $params["groupingid"] = $cm->groupingid;
$sql = "SELECT DISTINCT $ufields
FROM {lesson_attempts} a
INNER JOIN {user} u ON u.id = a.userid
INNER JOIN {groups_members} gm ON gm.userid = u.id
- INNER JOIN {groupings_groups} gg ON gm.groupid = :groupid
- WHERE a.lessonid = :lessonid
+ INNER JOIN {groupings_groups} gg ON gm.groupid = gg.groupid
+ WHERE a.lessonid = :lessonid AND
+ gg.groupingid = :groupingid
ORDER BY $sort";
} else {
$sql = "SELECT DISTINCT $ufields

0 comments on commit a083389

Please sign in to comment.