Skip to content

Commit 2a692e0

Browse files
author
Matthias Opitz
committed
using for feedback_tracker::count_missing_grades()
1 parent 8f88b8e commit 2a692e0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

block_my_feedback.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,20 @@ public static function get_mod_data($mod, $assess): ?stdClass {
204204
$duedate = feedback_tracker::get_duedate($mod);
205205
}
206206

207+
// Get the grade item associated with the module.
208+
require_once($CFG->libdir . '/gradelib.php');
209+
$gradeitem = grade_item::fetch([
210+
'itemtype' => 'mod',
211+
'itemmodule' => $mod->modname,
212+
'iteminstance' => $mod->instance,
213+
'itemnumber' => 0,
214+
'courseid' => $mod->course
215+
]);
216+
207217
// Return null if no duedate or no marking.
208218
// TODO - seems off to include this here, rather than in count_missing_grades..
209219
require_once($CFG->dirroot.'/mod/assign/locallib.php');
210-
if (!$duedate || !$assess->requiremarking = feedback_tracker::count_missing_grades($mod)) {
220+
if (!$duedate || !$assess->requiremarking = feedback_tracker::count_missing_grades($gradeitem, $mod)) {
211221
return null;
212222
}
213223

0 commit comments

Comments
 (0)