Merge branch 'MDL-35358_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE

This commit is contained in:
Dan Poltawski 2012-11-14 11:17:00 +08:00
commit 89a55cd9e0

View file

@ -269,12 +269,12 @@ switch ($mode) {
// Get all the users who have taken this lesson, order by their last name // Get all the users who have taken this lesson, order by their last name
$ufields = user_picture::fields('u'); $ufields = user_picture::fields('u');
if (!empty($cm->groupingid)) { if (!empty($cm->groupingid)) {
$params["groupinid"] = $cm->groupingid; $params["groupingid"] = $cm->groupingid;
$sql = "SELECT DISTINCT $ufields $sql = "SELECT DISTINCT $ufields
FROM {lesson_attempts} a FROM {lesson_attempts} a
INNER JOIN {user} u ON u.id = a.userid INNER JOIN {user} u ON u.id = a.userid
INNER JOIN {groups_members} gm ON gm.userid = u.id INNER JOIN {groups_members} gm ON gm.userid = u.id
INNER JOIN {groupings_groups} gg ON gm.groupid = :groupinid INNER JOIN {groupings_groups} gg ON gm.groupid = gg.groupid AND gg.groupingid = :groupingid
WHERE a.lessonid = :lessonid WHERE a.lessonid = :lessonid
ORDER BY u.lastname"; ORDER BY u.lastname";
} else { } else {