From a9b006548284d2007dab4d88046243b777b2fe75 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 21 May 2024 10:24:06 +1200 Subject: [PATCH] Fix #22 - use correct sortorder for criteria. --- locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locallib.php b/locallib.php index 03505b6..c70fbf8 100755 --- a/locallib.php +++ b/locallib.php @@ -186,7 +186,7 @@ function init(array $data): array { $criteriatable = 'gradingform_' . $data['grademethod'] . '_criteria'; } $data['criteriarecord'] = $DB->get_records_menu($criteriatable, - ['definitionid' => (int) $data['gradingdefinition']->definitionid], null, 'id, description'); + ['definitionid' => (int) $data['gradingdefinition']->definitionid], 'sortorder', 'id, description'); $data = header_fields($data, $data['criteriarecord'], $data['course'], $data['cm'], $data['gradingdefinition']); $data['definition'] = get_grading_definition($data['cm']->instance); $data['formaction'] = 'action='.$data['grademethod'] .'.php?id='.$data['courseid'].'&modid='.$data['modid'];