한 번도 태깅 안 한 학생은 미제출 대신 미등록으로 표시
This commit is contained in:
@@ -391,6 +391,17 @@ class _TeacherAttendancePageState extends State<TeacherAttendancePage> {
|
|||||||
return result;
|
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' / 'COMPLETE'를 반환한다.
|
||||||
/// - NONE: 아직 태깅 안 함
|
/// - NONE: 아직 태깅 안 함
|
||||||
/// - PENDING: 태깅은 했지만 지정된 출석시간 이전이라 아직 "출석 완료"로 안 침
|
/// - PENDING: 태깅은 했지만 지정된 출석시간 이전이라 아직 "출석 완료"로 안 침
|
||||||
@@ -406,6 +417,7 @@ class _TeacherAttendancePageState extends State<TeacherAttendancePage> {
|
|||||||
|
|
||||||
List<Map<String, dynamic>> get _combinedStudentStatus {
|
List<Map<String, dynamic>> get _combinedStudentStatus {
|
||||||
final checkIns = _todaysCheckInsByStudentId;
|
final checkIns = _todaysCheckInsByStudentId;
|
||||||
|
final everCheckedIn = _everCheckedInStudentIds;
|
||||||
return _roster.map((u) {
|
return _roster.map((u) {
|
||||||
final String id = u['id']?.toString() ?? '';
|
final String id = u['id']?.toString() ?? '';
|
||||||
final checkIn = checkIns[id];
|
final checkIn = checkIns[id];
|
||||||
@@ -419,6 +431,7 @@ class _TeacherAttendancePageState extends State<TeacherAttendancePage> {
|
|||||||
'checkInTime': checkIn?['time'],
|
'checkInTime': checkIn?['time'],
|
||||||
'attendanceStatus': attendanceStatus,
|
'attendanceStatus': attendanceStatus,
|
||||||
'isAttendanceComplete': attendanceStatus == 'COMPLETE',
|
'isAttendanceComplete': attendanceStatus == 'COMPLETE',
|
||||||
|
'hasEverCheckedIn': everCheckedIn.contains(id),
|
||||||
'hasActiveViolation': violation != null,
|
'hasActiveViolation': violation != null,
|
||||||
'violationPocket': violation?['pocket_number'],
|
'violationPocket': violation?['pocket_number'],
|
||||||
'violationTime': violation?['time'],
|
'violationTime': violation?['time'],
|
||||||
@@ -608,7 +621,9 @@ class _TeacherAttendancePageState extends State<TeacherAttendancePage> {
|
|||||||
? '학번: ${student['studentId']} | ⏳ 출석 미완료 (제출: ${student['checkInTime']})'
|
? '학번: ${student['studentId']} | ⏳ 출석 미완료 (제출: ${student['checkInTime']})'
|
||||||
: (isComplete
|
: (isComplete
|
||||||
? '학번: ${student['studentId']} | 제출시간: ${student['checkInTime']}'
|
? '학번: ${student['studentId']} | 제출시간: ${student['checkInTime']}'
|
||||||
: '학번: ${student['studentId']} | 미제출')),
|
: (student['hasEverCheckedIn'] == true
|
||||||
|
? '학번: ${student['studentId']} | 미제출'
|
||||||
|
: '학번: ${student['studentId']} | 미등록'))),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: hasViolation
|
color: hasViolation
|
||||||
? Colors.red[700]
|
? Colors.red[700]
|
||||||
@@ -809,7 +824,9 @@ class _TeacherAttendancePageState extends State<TeacherAttendancePage> {
|
|||||||
? '⏳ 출석 미완료 (제출: ${student['checkInTime']})'
|
? '⏳ 출석 미완료 (제출: ${student['checkInTime']})'
|
||||||
: (isComplete
|
: (isComplete
|
||||||
? '${student['checkInTime']}'
|
? '${student['checkInTime']}'
|
||||||
: '미제출')),
|
: (student['hasEverCheckedIn'] == true
|
||||||
|
? '미제출'
|
||||||
|
: '미등록'))),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: hasViolation
|
color: hasViolation
|
||||||
? Colors.red[700]
|
? Colors.red[700]
|
||||||
|
|||||||
Reference in New Issue
Block a user