feat: 完善听力口语辅助状态记录、练习分块与复习抽查间隔机制

This commit is contained in:
shen
2026-09-23 18:33:22 -07:00
parent 6b42b7abc3
commit d740a9e19c
106 changed files with 2933 additions and 845 deletions
+10 -2
View File
@@ -63,17 +63,25 @@ void main() {
expect(await store.read(), isNull);
const first = '''{
"revision": 1,
"attemptEvidence": [{"id":"a1","itemId":"A0-P01","taskId":"t1","skill":"speaking","inputMode":"speechToText","outcome":"independentSuccess","createdAt":"2026-09-14T00:00:00.000Z","assisted":false,"variantIndex":0,"originalTranscript":"Hello","transcriptConfirmed":true,"transcriptEdited":false}],
"attemptEvidence": [{"id":"a1","itemId":"A0-P01","taskId":"t1","skill":"speaking","inputMode":"speechToText","outcome":"independentSuccess","createdAt":"2026-09-14T00:00:00.000Z","assisted":false,"variantIndex":0,"originalTranscript":"Hello","transcriptConfirmed":true,"transcriptEdited":false,"firstTry":true,"attemptCount":1,"listeningSupport":"slow","usedSentenceBuild":true}],
"mastery": [{"id":"A0-P01","label":"Hello","status":"recognize","checkpoint":1,"needsReview":false}],
"reviews": [{"id":"A0-P01","dueAt":"2026-09-15T00:00:00.000Z","attempts":1,"successfulReviews":1,"variantIndex":0}],
"temporaryLexicon": [{"query":"library","definition":"图书馆","provider":"compatible","model":"demo","createdAt":"2026-09-14T00:00:00.000Z"}],
"lessonStep":"speaking", "activeLessonId":"a0-01"
"lessonStep":"speaking", "activeLessonId":"a0-01",
"listeningAudioPlayed":true,"listeningSupport":"slow","listeningAttempts":1,
"sentenceBuildUsed":true,"sentenceBuildIndex":2
}''';
await store.write(first);
final restored =
jsonDecode((await store.read())!) as Map<String, dynamic>;
expect(restored['lessonStep'], 'speaking');
expect(restored['attemptEvidence'], hasLength(1));
expect(restored['attemptEvidence'][0]['firstTry'], isTrue);
expect(restored['attemptEvidence'][0]['attemptCount'], 1);
expect(restored['attemptEvidence'][0]['listeningSupport'], 'slow');
expect(restored['attemptEvidence'][0]['usedSentenceBuild'], isTrue);
expect(restored['listeningSupport'], 'slow');
expect(restored['sentenceBuildIndex'], 2);
expect(restored['mastery'], hasLength(1));
expect(
await executor.runSelect(