整个课程和数据UI重新设计版本
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:kouyu_english/core/seed_courses.dart';
|
||||
import 'package:kouyu_english/core/courses/courses.dart';
|
||||
|
||||
const _digitWords = {
|
||||
'0': 'zero',
|
||||
@@ -23,10 +23,7 @@ String _normalize(String text) =>
|
||||
/// 逐字母拼写(S-H-E-N)先去掉连字符。
|
||||
bool _appearsInReading(String reading, String option) {
|
||||
final haystack = _normalize(
|
||||
reading.replaceAllMapped(
|
||||
RegExp(r'\d'),
|
||||
(match) => _digitWords[match[0]]!,
|
||||
),
|
||||
reading.replaceAllMapped(RegExp(r'\d'), (match) => _digitWords[match[0]]!),
|
||||
);
|
||||
final tokens = option
|
||||
.replaceAll('-', '')
|
||||
@@ -38,10 +35,7 @@ bool _appearsInReading(String reading, String option) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
final activities = <String, LessonActivity>{
|
||||
...a0Activities,
|
||||
...a0SegmentActivities,
|
||||
};
|
||||
final activities = segmentActivities;
|
||||
|
||||
group('阅读找答案题', () {
|
||||
test('每题三个选项,第一项是标准答案', () {
|
||||
@@ -92,7 +86,8 @@ void main() {
|
||||
options[i].contains(options[j]) ||
|
||||
options[j].contains(options[i]),
|
||||
isFalse,
|
||||
reason: '${entry.key}:“${entry.value.readingOptions[i]}”与'
|
||||
reason:
|
||||
'${entry.key}:“${entry.value.readingOptions[i]}”与'
|
||||
'“${entry.value.readingOptions[j]}”互为子串,会被判分逻辑当成同一个答案',
|
||||
);
|
||||
}
|
||||
@@ -130,7 +125,8 @@ void main() {
|
||||
'${activity.listening}-listening',
|
||||
);
|
||||
final listeningSlot = listening.indexOf(activity.answers.first);
|
||||
listeningSlots[listeningSlot] = (listeningSlots[listeningSlot] ?? 0) + 1;
|
||||
listeningSlots[listeningSlot] =
|
||||
(listeningSlots[listeningSlot] ?? 0) + 1;
|
||||
}
|
||||
for (final slots in [readingSlots, listeningSlots]) {
|
||||
expect(slots.keys.toSet(), {0, 1, 2});
|
||||
|
||||
Reference in New Issue
Block a user