diff --git a/mod/lesson/essay.php b/mod/lesson/essay.php index 56b764f8fc8..3a5235d2469 100644 --- a/mod/lesson/essay.php +++ b/mod/lesson/essay.php @@ -30,7 +30,7 @@ // Get only the attempts that are in response to essay questions if ($essayattempts = get_records_select('lesson_attempts', 'pageid IN('.implode(',', array_keys($pages)).')')) { // Get all the users who have taken this lesson, order by their last name - if (!$users = get_records_sql("SELECT DISTINCT u.* + if (!$users = get_records_sql("SELECT u.* FROM {$CFG->prefix}user u, {$CFG->prefix}lesson_attempts a WHERE a.lessonid = '$lesson->id' and @@ -130,7 +130,7 @@ } } else { $queryadd = ''; - if (!$users = get_records_sql("SELECT DISTINCT u.* + if (!$users = get_records_sql("SELECT u.* FROM {$CFG->prefix}user u, {$CFG->prefix}lesson_attempts a WHERE a.lessonid = '$lesson->id' and diff --git a/mod/lesson/report.php b/mod/lesson/report.php index a4fa18f7d65..6d4d32a9872 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -17,7 +17,7 @@ list($cm, $course, $lesson) = lesson_get_basics($id); - if (! $students = get_records_sql("SELECT DISTINCT u.* + if (! $students = get_records_sql("SELECT u.* FROM {$CFG->prefix}user u, {$CFG->prefix}lesson_attempts a WHERE a.lessonid = '$lesson->id' and