From d22946d67557e981e2b682783a06460320866cf1 Mon Sep 17 00:00:00 2001 From: Stuart Lamour Date: Fri, 10 Jan 2025 13:58:10 +0000 Subject: [PATCH] CI update --- block_my_feedback.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/block_my_feedback.php b/block_my_feedback.php index b981b5e..31a1ab1 100644 --- a/block_my_feedback.php +++ b/block_my_feedback.php @@ -124,8 +124,7 @@ public static function fetch_marking(stdClass $user): ?array { // Get course mod ids. $modinfo = get_fast_modinfo($course->id); $mods = $modinfo->get_cms(); - $cmids = array_column($mods, 'id'); // Efficiently get cmids - + $cmids = array_column($mods, 'id'); // Loop through assessments for this course. foreach ($summatives as $summative) { @@ -200,7 +199,7 @@ public static function get_mod_data($mod, $assess): ?stdClass { // Get duedate. if ($mod->modname === 'turnitintooltwo') { - $duedate = $DB->get_field('turnitintooltwo_parts', 'dtdue', ['id' => $assess->partid],); + $duedate = $DB->get_field('turnitintooltwo_parts', 'dtdue', ['id' => $assess->partid], ); $duedate = $record->dtdue; } else { $duedate = feedback_tracker::get_duedate($mod); @@ -231,18 +230,18 @@ public static function get_mod_data($mod, $assess): ?stdClass { * @param stdClass $course */ public static function is_course_current(stdClass $course): bool { - // Check if the course has started + // Check if the course has started. if ($course->startdate > time()) { return false; } - // Check if the course has ended (with a 3-month grace period) + // Check if the course has ended (with a 3-month grace period). if (isset($course->enddate) && $course->enddate != 0 && time() > strtotime('+3 month', $course->enddate)) { return false; } - // Course is within the valid date range + // Course is within the valid date range. return true; } @@ -252,10 +251,10 @@ public static function is_course_current(stdClass $course): bool { * @param int $duedate */ public static function duedate_in_range(int $duedate): ?int { - $startDate = strtotime('-2 month'); - $cutoffDate = strtotime('+1 month'); + $startdate = strtotime('-2 month'); + $cutoffdate = strtotime('+1 month'); - if ($duedate < $startDate || $duedate > $cutoffDate) { + if ($duedate < $startdate || $duedate > $cutoffdate) { return null; }