From ab44375d0f80221e26468b545b4a72cd547a0920 Mon Sep 17 00:00:00 2001 From: Guillaume Barat Date: Mon, 24 Jun 2024 15:13:21 +1000 Subject: [PATCH] add instance status --- classes/rubric_ranges.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; }