feat: release undergraduate integration 0.7.0

This commit is contained in:
Codex
2026-10-15 01:14:06 +08:00
parent b28f333720
commit 674df1ceb3
22 changed files with 173 additions and 63 deletions
+6 -3
View File
@@ -8,13 +8,16 @@ import '../features/school/undergraduate/exam_adapter.dart';
class ExamFileImport {
static ExamSchedule parse(String content) {
if (utf8.encode(content).length > 2 * 1024 * 1024)
if (utf8.encode(content).length > 2 * 1024 * 1024) {
throw const FormatException('文件不能超过2MB');
}
final doc = html.parse(content.replaceFirst('\uFEFF', ''));
if (doc.querySelector('#stdExamTableForm') != null)
if (doc.querySelector('#stdExamTableForm') != null) {
return UndergraduateExamAdapter.extract(content);
if (doc.querySelector('#sample-table-1') != null)
}
if (doc.querySelector('#sample-table-1') != null) {
return SchoolExamAdapter.extract(content);
}
throw const FormatException('未识别到学校排考页面');
}
}