diff --git a/lib/screens/teacher_attendance_page.dart b/lib/screens/teacher_attendance_page.dart index 9073a46..c065f69 100644 --- a/lib/screens/teacher_attendance_page.dart +++ b/lib/screens/teacher_attendance_page.dart @@ -391,6 +391,17 @@ class _TeacherAttendancePageState extends State { return result; } + /// 지금까지(오늘 이전 포함) 단 한 번이라도 태깅한 적 있는 학생 학번 집합. + /// (오늘 미제출인 학생 중에서도 "한 번도 태깅 안 해본 애"를 구분하기 위함) + Set get _everCheckedInStudentIds { + final Set ids = {}; + for (final log in _logs) { + final String studentId = log['student_id']?.toString() ?? ''; + if (studentId.isNotEmpty) ids.add(studentId); + } + return ids; + } + /// ⏰ 태깅 시간과 지정된 자습실 출석시간을 비교해 'NONE' / 'PENDING' / 'COMPLETE'를 반환한다. /// - NONE: 아직 태깅 안 함 /// - PENDING: 태깅은 했지만 지정된 출석시간 이전이라 아직 "출석 완료"로 안 침 @@ -406,6 +417,7 @@ class _TeacherAttendancePageState extends State { List> get _combinedStudentStatus { final checkIns = _todaysCheckInsByStudentId; + final everCheckedIn = _everCheckedInStudentIds; return _roster.map((u) { final String id = u['id']?.toString() ?? ''; final checkIn = checkIns[id]; @@ -419,6 +431,7 @@ class _TeacherAttendancePageState extends State { 'checkInTime': checkIn?['time'], 'attendanceStatus': attendanceStatus, 'isAttendanceComplete': attendanceStatus == 'COMPLETE', + 'hasEverCheckedIn': everCheckedIn.contains(id), 'hasActiveViolation': violation != null, 'violationPocket': violation?['pocket_number'], 'violationTime': violation?['time'], @@ -608,7 +621,9 @@ class _TeacherAttendancePageState extends State { ? '학번: ${student['studentId']} | ⏳ 출석 미완료 (제출: ${student['checkInTime']})' : (isComplete ? '학번: ${student['studentId']} | 제출시간: ${student['checkInTime']}' - : '학번: ${student['studentId']} | 미제출')), + : (student['hasEverCheckedIn'] == true + ? '학번: ${student['studentId']} | 미제출' + : '학번: ${student['studentId']} | 미등록'))), style: TextStyle( color: hasViolation ? Colors.red[700] @@ -809,7 +824,9 @@ class _TeacherAttendancePageState extends State { ? '⏳ 출석 미완료 (제출: ${student['checkInTime']})' : (isComplete ? '${student['checkInTime']}' - : '미제출')), + : (student['hasEverCheckedIn'] == true + ? '미제출' + : '미등록'))), style: TextStyle( color: hasViolation ? Colors.red[700]