한 번도 태깅 안 한 학생은 미제출 대신 미등록으로 표시

This commit is contained in:
2026-08-04 14:47:15 +09:00
parent 5ab1c4c37c
commit 61aedac312
+19 -2
View File
@@ -391,6 +391,17 @@ class _TeacherAttendancePageState extends State<TeacherAttendancePage> {
return result;
}
/// 지금까지(오늘 이전 포함) 단 한 번이라도 태깅한 적 있는 학생 학번 집합.
/// (오늘 미제출인 학생 중에서도 "한 번도 태깅 안 해본 애"를 구분하기 위함)
Set<String> get _everCheckedInStudentIds {
final Set<String> 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<TeacherAttendancePage> {
List<Map<String, dynamic>> 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<TeacherAttendancePage> {
'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<TeacherAttendancePage> {
? '학번: ${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<TeacherAttendancePage> {
? '⏳ 출석 미완료 (제출: ${student['checkInTime']})'
: (isComplete
? '${student['checkInTime']}'
: '미제출')),
: (student['hasEverCheckedIn'] == true
? '미제출'
: '미등록'))),
style: TextStyle(
color: hasViolation
? Colors.red[700]