fix logic and tests, update docker CI file
This commit is contained in:
@@ -25,8 +25,16 @@ class TeacherSubmissionSupportService
|
||||
];
|
||||
}
|
||||
|
||||
public function attendanceStatus(bool $submitted): array
|
||||
public function attendanceStatus(bool $submitted, int $expected): array
|
||||
{
|
||||
if ($expected <= 0) {
|
||||
return [
|
||||
'label' => 'No students',
|
||||
'badge' => 'bg-secondary',
|
||||
'completed' => true,
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'label' => $submitted ? 'Submitted' : 'Missing',
|
||||
'badge' => $submitted ? 'bg-success' : 'bg-danger',
|
||||
@@ -115,4 +123,4 @@ class TeacherSubmissionSupportService
|
||||
$last = array_pop($items);
|
||||
return implode(', ', $items) . ' and ' . $last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user