Skip to content

Commit f706538

Browse files
committed
fix: postgraduate exam
1 parent 5ead5db commit f706538

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PODS:
4040
- Flutter (1.0.0)
4141
- flutter_mailer (0.0.1):
4242
- Flutter
43-
- flutter_native_splash (0.0.1):
43+
- flutter_native_splash (2.4.3):
4444
- Flutter
4545
- fluttertoast (0.0.2):
4646
- Flutter
@@ -172,7 +172,7 @@ SPEC CHECKSUMS:
172172
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
173173
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
174174
flutter_mailer: 2ef5a67087bc8c6c4cefd04a178bf1ae2c94cd83
175-
flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778
175+
flutter_native_splash: e8a1e01082d97a8099d973f919f57904c925008a
176176
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
177177
home_widget: 0434835a4c9a75704264feff6be17ea40e0f0d57
178178
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4

lib/model/xidian_ids/exam.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ class Subject {
1616
String place;
1717
String? seat;
1818

19-
static RegExp timeRegExp = RegExp(
19+
static RegExp timeRegExpUnderGraduate = RegExp(
2020
r'^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) (?<hour>\d{2})(::?)(?<minute>\d{2})-(?<stopHour>\d{2})(::?)(?<stopMinute>\d{2})',
2121
);
22+
static RegExp timeRegExpPostGraduate = RegExp(
23+
r'^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) (.{3})\((?<hour>\d{2})(::?)(?<minute>\d{2})-(?<stopHour>\d{2})(::?)(?<stopMinute>\d{2})\)',
24+
);
2225

2326
@override
2427
String toString() => "$subject $typeStr $type $time $place $seat\n";
2528

2629
Jiffy? get startTime {
27-
RegExpMatch? match = timeRegExp.firstMatch(time);
30+
RegExpMatch? match = timeRegExpUnderGraduate.firstMatch(time) ??
31+
timeRegExpPostGraduate.firstMatch(time);
2832
if (match == null) return null;
2933

3034
return Jiffy.parseFromDateTime(DateTime(
@@ -37,7 +41,8 @@ class Subject {
3741
}
3842

3943
Jiffy? get stopTime {
40-
RegExpMatch? match = timeRegExp.firstMatch(time);
44+
RegExpMatch? match = timeRegExpUnderGraduate.firstMatch(time) ??
45+
timeRegExpPostGraduate.firstMatch(time);
4146
if (match == null) return null;
4247

4348
return Jiffy.parseFromDateTime(DateTime(
@@ -64,7 +69,8 @@ class Subject {
6469
required String place,
6570
String? seat,
6671
}) {
67-
RegExpMatch? match = timeRegExp.firstMatch(time);
72+
RegExpMatch? match = timeRegExpUnderGraduate.firstMatch(time) ??
73+
timeRegExpPostGraduate.firstMatch(time);
6874
late String startTime, stopTime;
6975
if (match != null) {
7076
startTime = Jiffy.parseFromDateTime(DateTime(

lib/page/classtable/class_table_view/class_organized_data.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ class ClassOrgainzedData {
161161
}
162162
}
163163

164+
if (timeInMin >
165+
int.parse(_timeInBlock.last.split(":")[0]) * 60 +
166+
int.parse(_timeInBlock.last.split(":")[1])) {
167+
return 61;
168+
}
169+
164170
throw OutOfIndexException();
165171
}
166172

0 commit comments

Comments
 (0)