Permalink
Browse files

MDL-43408 gradereport_grader: Display users with expired enrolments a…

…s inactive in grader report
  • Loading branch information...
tonyjbutler authored and danpoltawski committed Dec 16, 2013
1 parent 0cb1903 commit cf3f46344ebd3c93b83c0a70300d3f0ec270be10
Showing with 4 additions and 1 deletion.
  1. +4 −1 grade/report/grader/lib.php
@@ -472,9 +472,12 @@ public function load_users() {
AND ue.status = :uestatus
AND e.status = :estatus
AND e.courseid = :courseid
+ AND ue.timestart < :now1 AND (ue.timeend = 0 OR ue.timeend > :now2)
GROUP BY ue.userid";
$coursecontext = $this->context->get_course_context(true);
- $params = array_merge($uparams, array('estatus'=>ENROL_INSTANCE_ENABLED, 'uestatus'=>ENROL_USER_ACTIVE, 'courseid'=>$coursecontext->instanceid));
+ $time = time();
+ $params = array_merge($uparams, array('estatus' => ENROL_INSTANCE_ENABLED, 'uestatus' => ENROL_USER_ACTIVE,
+ 'courseid' => $coursecontext->instanceid, 'now1' => $time, 'now2' => $time));
$useractiveenrolments = $DB->get_records_sql($sql, $params);
$defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);

0 comments on commit cf3f463

Please sign in to comment.