fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
@@ -14,7 +14,8 @@ class TeacherSubmissionReportService
public function __construct(
protected AdministratorSharedService $shared,
protected TeacherSubmissionSupportService $support
) {}
) {
}
public function report(array $filters = []): array
{
@@ -55,14 +56,14 @@ class TeacherSubmissionReportService
default => $roleKey !== '' ? ucfirst($roleKey) : 'Teacher',
};
$teacherFullName = trim(($assignment['firstname'] ?? '').' '.($assignment['lastname'] ?? ''));
$teacherFullName = trim(($assignment['firstname'] ?? '') . ' ' . ($assignment['lastname'] ?? ''));
$teacherId = (int) ($assignment['teacher_id'] ?? 0);
if ($teacherFullName === '' || $teacherId <= 0) {
continue;
}
if (! isset($teachersBySection[$sectionId])) {
if (!isset($teachersBySection[$sectionId])) {
$teachersBySection[$sectionId] = [
'class_section' => $assignment['class_section_name'] ?? "Section {$sectionId}",
'teachers' => [],
@@ -112,7 +113,7 @@ class TeacherSubmissionReportService
foreach ($scoreRecords as $score) {
$sid = (int) ($score->student_id ?? 0);
if ($sid <= 0 || ($expected > 0 && ! in_array($sid, $studentIds, true))) {
if ($sid <= 0 || ($expected > 0 && !in_array($sid, $studentIds, true))) {
continue;
}
@@ -128,7 +129,7 @@ class TeacherSubmissionReportService
$midtermCommentStudents = [];
$ptapCommentStudents = [];
if (! empty($studentIds)) {
if (!empty($studentIds)) {
$comments = ScoreComment::query()
->select('student_id', 'score_type', 'comment')
->whereIn('student_id', $studentIds)
@@ -176,7 +177,7 @@ class TeacherSubmissionReportService
);
foreach ($teacherList as $teacherEntry) {
if (! empty($teacherEntry['id'])) {
if (!empty($teacherEntry['id'])) {
$allTeacherIds[] = $teacherEntry['id'];
}
}
@@ -263,7 +264,7 @@ class TeacherSubmissionReportService
continue;
}
$adminName = trim(($record->firstname ?? '').' '.($record->lastname ?? ''));
$adminName = trim(($record->firstname ?? '') . ' ' . ($record->lastname ?? ''));
if ($adminName === '') {
$adminName = 'Administrator';
}