diff --git a/classes/rubric_ranges.php b/classes/rubric_ranges.php index 59bd80b..995316a 100644 --- a/classes/rubric_ranges.php +++ b/classes/rubric_ranges.php @@ -24,6 +24,9 @@ namespace report_advancedgrading; +defined('MOODLE_INTERNAL') || die(); + +require_once($CFG->dirroot . '/grade/grading/form/lib.php'); /** * Logic to process data for assignments using the rubric range grading method * @@ -96,9 +99,10 @@ public function get_data(\assign $assign, \cm_info $cm): array { JOIN {user} rubm ON rubm.id = ag.grader JOIN {gradingform_rubric_ranges_f} grf ON (grf.instanceid = gin.id) AND (grf.criterionid = criteria.id) AND (grf.levelid = level.id) - WHERE cm.id = :assignid AND stu.deleted = 0 + WHERE cm.id = :assignid AND gin.status = :instancestatus AND stu.deleted = 0 ORDER BY lastname ASC, firstname ASC, userid ASC, criteria.sortorder ASC"; - $data = $DB->get_records_sql($sql, ['assignid' => $cm->id]); + $data = $DB->get_records_sql($sql, ['assignid' => $cm->id, + 'instancestatus' => \gradingform_instance::INSTANCE_STATUS_ACTIVE]); $data = set_blindmarking($data, $assign, $cm); return $data; }