Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-35175 - Lesson shows no attempts if associated with a grouping

  • Loading branch information...
commit b20c4d58dbbe12a2644437433156fe9d54d5a262 1 parent 0e6d8bc
Rex Lorenzo authored rlorenzo committed

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 7  mod/lesson/report.php
7  mod/lesson/report.php
@@ -47,13 +47,14 @@
47 47
 $params = array_merge($params, $sortparams);
48 48
 // TODO: Improve this. Fetching all students always is crazy!
49 49
 if (!empty($cm->groupingid)) {
50  
-    $params["groupid"] = $cm->groupingid;
  50
+    $params["groupingid"] = $cm->groupingid;
51 51
     $sql = "SELECT DISTINCT $ufields
52 52
                 FROM {lesson_attempts} a
53 53
                     INNER JOIN {user} u ON u.id = a.userid
54 54
                     INNER JOIN {groups_members} gm ON gm.userid = u.id
55  
-                    INNER JOIN {groupings_groups} gg ON gm.groupid = :groupid
56  
-                WHERE a.lessonid = :lessonid
  55
+                    INNER JOIN {groupings_groups} gg ON gm.groupid = gg.groupid
  56
+                WHERE a.lessonid = :lessonid AND
  57
+                      gg.groupingid = :groupingid
57 58
                 ORDER BY $sort";
58 59
 } else {
59 60
     $sql = "SELECT DISTINCT $ufields

0 notes on commit b20c4d5

Please sign in to comment.
Something went wrong with that request. Please try again.