From 61aedac3126ceb9c13215dda3b3117447a441e9c Mon Sep 17 00:00:00 2001 From: sihoo Date: Tue, 4 Aug 2026 14:47:15 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=9C=20=EB=B2=88=EB=8F=84=20=ED=83=9C?= =?UTF-8?q?=EA=B9=85=20=EC=95=88=20=ED=95=9C=20=ED=95=99=EC=83=9D=EC=9D=80?= =?UTF-8?q?=20=EB=AF=B8=EC=A0=9C=EC=B6=9C=20=EB=8C=80=EC=8B=A0=20=EB=AF=B8?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=EC=9C=BC=EB=A1=9C=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/screens/teacher_attendance_page.dart | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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]