Skip to content

Commit

Permalink
CI update
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartlamour committed Jan 10, 2025
1 parent 07a6a4d commit d22946d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions block_my_feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit d22946d

Please sign in to comment.