From: gregb_cc Date: Fri, 14 Mar 2003 19:58:53 +0000 (+0000) Subject: This closes bug http://moodle.org/bugs/bug.php?op=show&bugid=310 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a2631c99d9ed4a9a7c33a8da9a8a644a95656033;p=moodle.git This closes bug http://moodle.org/bugs/bug.php?op=show&bugid=310 assignment_get_unmailed_submissions now ensures that a student is still enrolled --- diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 682df5ee78..bdcb607ab1 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -260,15 +260,18 @@ function assignment_get_users_done($assignment) { } function assignment_get_unmailed_submissions($cutofftime) { -/// Return list of marked submissions that have not been mailed out +/// Return list of marked submissions that have not been mailed out for currently enrolled students global $CFG; return get_records_sql("SELECT s.*, a.course, a.name FROM {$CFG->prefix}assignment_submissions s, - {$CFG->prefix}assignment a + {$CFG->prefix}assignment a, + {$CFG->prefix}user_students us WHERE s.mailed = 0 AND s.timemarked < $cutofftime AND s.timemarked > 0 - AND s.assignment = a.id"); + AND s.assignment = a.id + AND s.userid = us.userid + AND a.course = us.course"); }