Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/timetable/korea-sejong-2026-2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/timetable/korea-seoul-2026-2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/UNIVERSITY_SUPPORT_STATUS_2026-10-06.json
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@
"campusEvidence": "Sejong official 2026-08-26 revision notice links common undergraduate registrar calendar. All66 Feb-Dec2026 rows of attached revised integrated XLS match public monthly dates/titles exactly; January adds2 events. Annual view lacks duration endpoints and is not used."
},
"timetable": {
"status": "temporarily_unsupported",
"status": "implemented_catalog_partial",
"universityId": "korea",
"courses": 5339,
"scheduled": 4173,
Expand Down
1 change: 0 additions & 1 deletion lib/core/academic/university_support_policy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class UniversitySupportPolicy {
'kongju',
'konkuk',
'kookmin',
'korea',
'koreatech',
'kumoh',
'kunsan',
Expand Down
169 changes: 164 additions & 5 deletions test/features/timetable/korea_catalog_data_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:daily/features/timetable/data/timetable_sync_document.dart';
import 'package:daily/features/timetable/domain/timetable.dart';
import 'package:daily/features/timetable/domain/university_course.dart';

import 'korea_public_recheck.dart';

void main() {
test(
'KU current Sejong source clocks and dates preserve user modes through full Drive JSON',
Expand Down Expand Up @@ -199,12 +201,12 @@ void main() {
'seoul': (
[540, 630, 720, 810, 900, 990, 1080, 1140, 1200, 1260],
[615, 705, 795, 885, 975, 1065, 1130, 1190, 1250, 1310],
62148,
63797,
),
'sejong': (
[540, 600, 660, 720, 780, 840, 900, 960, 1020, 1080, 1140, 1200, 1260],
[590, 650, 710, 770, 830, 890, 950, 1010, 1070, 1130, 1190, 1250, 1310],
28024,
28166,
),
};
for (final entry in slots.entries) {
Expand All @@ -224,10 +226,10 @@ void main() {
final start = s['startMinute'] as int;
final end = s['endMinute'] as int;
// 480은 서울 일반 0교시(08:00~08:50)로, 체육교육과 주말 4개 강좌(SAEK232·SAEK242
// `토(0-1)`, SAEK334·SAEK434 `일(0-1)`)만 쓴다. 근거는 수강신청 교시표 사본
// `토(0-1)`, SAEK334·SAEK434 `일(0-1)`)와 지리교육과 `토(0)` 3개 강좌(GEOG172·272·372,
// 2026-11-23 확정)가 쓴다. 근거는 수강신청 교시표 사본
// (source-current-ui-regular-campus-clock-education.json의 0교시 행)이다.
// 다른 0교시 강좌 15개(교직 0교시 08:40~, 끝 시각 없음인 교직 13개 포함)는 시간 없이
// 보류되어 여기 오지 않는다.
// 교직 0교시 강좌 12개는 교직과목 0교시(08:40~) 원문으로 520에서 시작해 여기 오지 않는다.
if (start == 480) continue;
expect(
starts.contains(start) && periodEnds.contains(end),
Expand All @@ -254,4 +256,161 @@ void main() {
expect(count, total, reason: entry.key);
}
});

test('KU 2026-11-23 공식 교시표 확정 강좌는 원문 요일·교시 그대로 구간을 만든다', () {
final byId = <String, Map<String, dynamic>>{};
for (final campus in ['seoul', 'sejong']) {
final data =
jsonDecode(
fixtureFile(
'assets/timetable/korea-$campus-2026-2.json',
).readAsStringSync(),
)
as Map<String, dynamic>;
expect(
data['periodEvidence']['sourceUrl'],
'https://koreanstudies.korea.ac.kr/bbs/software/352/181231/download.do',
);
for (final c in data['courses'] as List) {
byId[c['sourceId'] as String] = c as Map<String, dynamic>;
}
}
final statuses = <String, int>{};
for (final id in koreaOfficialTimes.keys) {
final c = byId[id]!;
final status = c['scheduleStatus'] as String;
statuses[status] = (statuses[status] ?? 0) + 1;
expect(
c['schedules'],
status == 'scheduled' ? koreaOfficialSchedules(c) : isEmpty,
reason: id,
);
if (status == 'scheduled') {
expect(c['remarks'], contains('공식 요일·교시 기준 확정'), reason: id);
expect(c['remarks'], isNot(contains('일정 보류')), reason: id);
} else {
expect(c['remarks'], contains('원문 교시 표기를 보존한 채 시간 미정'), reason: id);
}
}
expect(statuses, {'scheduled': 95, 'unscheduled': 6});

// 교직 0교시는 08:40 시작, 1교시 시작(09:00)까지를 0교시 슬롯으로 보고 1교시와 합친다.
final teaching = byId['korea/seoul/2026-2/SEDU101-01']!;
expect(teaching['sourceSchedule'], '수(0-1) 교육관 501호');
expect(
{
for (final s in teaching['schedules'] as List)
(s['weekday'], s['startMinute'], s['endMinute'], s['classroom']),
},
{(3, 520, 630, '교육관 501호')},
);

// 서울 화(10-12): 10교시 21:00 시작, 표 밖 11·12교시는 60분 슬롯으로 이어 24:00까지.
final lab = byId['korea/seoul/2026-2/KMSE302-01']!;
expect(lab['sourceSchedule'], '화(10-12)');
expect(
{
for (final s in lab['schedules'] as List)
(s['weekday'], s['startMinute'], s['endMinute']),
},
{(2, 1260, 1440)},
);
// 같은 시각에 강의실이 둘이면 원문 강의실마다 구간을 둔다.
final twoRooms = byId['korea/seoul/2026-2/ACEE232-00']!;
expect(
{
for (final s in twoRooms['schedules'] as List)
(s['weekday'], s['startMinute'], s['endMinute'], s['classroom']),
},
{
(2, 720, 810, '신공학관 B105호'),
(2, 720, 810, '신공학관 B109호-전산실습실'),
(4, 720, 810, '신공학관 B105호'),
},
);
// 세종 목9교시(17:00~17:50)는 분반별 강의실로 주간 반복 확정.
final sejong = byId['korea/sejong/2026-2/spa-181339-t0-r9-c4-item20']!;
expect(sejong['scheduleStatus'], 'scheduled');
final first = (sejong['schedules'] as List).first as Map;
expect(first, {
'weekday': 4,
'startMinute': 1020,
'endMinute': 1080,
'classroom': '2-329',
'date': '2026-09-03',
});
// 24시를 넘는 교시 번호(약학과 토(8-17) 등)는 시각을 만들지 않고 원문을 보존한 시간 미정으로 둔다.
final pharmacy = byId['korea/sejong/2026-2/PHAR528-00']!;
expect(pharmacy['scheduleStatus'], 'unscheduled');
expect(pharmacy['schedules'], isEmpty);
expect(pharmacy['sourceSchedule'], contains('토(8-17)'));
});

test('KU 의학과 공개 강의계획서 첨부의 회차별 날짜·교시로 확정한 강좌', () {
final data =
jsonDecode(
fixtureFile(
'assets/timetable/korea-seoul-2026-2.json',
).readAsStringSync(),
)
as Map<String, dynamic>;
final evidence =
jsonDecode(
fixtureFile(
'tool/timetable/korea_medicine_sessions_2026_2.json',
).readAsStringSync(),
)
as Map<String, dynamic>;
final byId = {
for (final c in data['courses'] as List)
c['sourceId'] as String: c as Map<String, dynamic>,
};
final courses = evidence['courses'] as Map<String, dynamic>;
expect(courses, hasLength(15));
for (final entry in courses.entries) {
final c = byId[entry.key]!;
expect(c['scheduleStatus'], 'scheduled', reason: entry.key);
expect(c['sourceSchedule'], '', reason: entry.key);
final period = c['period'] as Map;
for (final s in c['schedules'] as List) {
final date = s['date'] as String;
expect(
date.compareTo(period['startDate'] as String) >= 0 &&
date.compareTo(period['endDate'] as String) <= 0,
isTrue,
reason: '${entry.key} $date',
);
expect(
DateTime.parse(date).weekday,
s['weekday'],
reason: '${entry.key} $date',
);
}
}
// 응급의학: 11.24(화) 1·2교시, 11.27(금) 1~6교시, 12.7(월) 1~5교시, 12.10(목) 4·5교시.
// 교시 슬롯은 50분+10분, 4교시 뒤 점심(50분)은 60분 미만이라 합친다.
expect(
[
for (final s
in byId['korea/seoul/2026-2/MEDI230-00']!['schedules'] as List)
(s['date'], s['startMinute'], s['endMinute']),
],
[
('2026-11-24', 510, 630),
('2026-11-27', 510, 920),
('2026-12-07', 510, 860),
('2026-12-10', 690, 860),
],
);
// 미생물학은 8월 24일 개강이라 강좌 기간 시작을 첫 회차로 넓혔다.
final micro = byId['korea/seoul/2026-2/MEDI108-00']!;
expect(micro['period']['startDate'], '2026-08-24');
expect((micro['schedules'] as List).first, {
'weekday': 1,
'startMinute': 510,
'endMinute': 630,
'classroom': '',
'date': '2026-08-24',
});
});
}
8 changes: 4 additions & 4 deletions test/features/timetable/korea_current_remarkful_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ List<String> ownDates(int weekday) {

void main() {
test(
'KU exact current raw79 remarkful ownclock, other5260 preserved and full4173 three-mode Drive',
'KU exact current raw79 remarkful ownclock, other5260 preserved and full4283 three-mode Drive',
() {
final audit = read(
'whole-remaining1245-native79-remark-operating-audit.json',
Expand Down Expand Up @@ -211,8 +211,8 @@ void main() {
}
expect(newMeetings, 1241);
expect(all, hasLength(5339));
expect(all.where((c) => c.hasSchedulableMeetings), hasLength(4173));
expect(all.fold<int>(0, (n, c) => n + c.meetings.length), 90172);
expect(all.where((c) => c.hasSchedulableMeetings), hasLength(4283));
expect(all.fold<int>(0, (n, c) => n + c.meetings.length), 91963);
for (final mode in [
LectureMode.inPerson,
LectureMode.liveOnline,
Expand All @@ -231,7 +231,7 @@ void main() {
final restored = TimetableSyncDocument.fromJson(
jsonDecode(jsonEncode(doc.toJson())) as Map<String, dynamic>,
).materializeClasses();
expect(restored, hasLength(4173));
expect(restored, hasLength(4283));
final by = {for (final c in classes) c.sourceId: c};
for (final c in restored) {
final original = by[c.sourceId]!;
Expand Down
Loading
Loading