fix: 修正学习流程中的证据、复习与进度问题
- 独立尝试按课程要求校验内容,不再任意输入即算独立成功 - 复习节点改为学后第 1/3/7/14 天,之后每 30 天抽查;复习轮换情境 - 掌握状态按作答记录推导:需认识、可回忆、跨情境使用及最近两次无帮助 - 课程证据按实际用到的目标记录;跟读与课程对话只算辅助练习 - 复习成功不再降低已有状态 - 学完课程后进入下一节未完成课程;全部学完后引导巩固与阶段评估 - 新增 3 题基础定位,按结果设置起始课程 - 新增按课程开放的对话场景,首页推荐最少练习的场景 - 切换课程时清空上一课的步骤进度 - AI 返回 JSON 格式并按 JSON 回放历史;拼写校验忽略大小写与连字符;移除学习目标选择 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,12 +12,16 @@ class HomePage extends StatelessWidget {
|
||||
required this.onStartPrimaryTask,
|
||||
required this.onOpenDialogue,
|
||||
required this.onResumeLessonDialogue,
|
||||
required this.onStartReinforcement,
|
||||
required this.onOpenAssessment,
|
||||
});
|
||||
|
||||
final AppState state;
|
||||
final VoidCallback onStartPrimaryTask;
|
||||
final VoidCallback onOpenDialogue;
|
||||
final VoidCallback onResumeLessonDialogue;
|
||||
final VoidCallback onStartReinforcement;
|
||||
final ValueChanged<String> onOpenAssessment;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -26,16 +30,21 @@ class HomePage extends StatelessWidget {
|
||||
final activeLesson = lessonById(state.activeLessonId);
|
||||
final activeSegment = state.activeSegmentIndexFor(activeLesson.id) + 1;
|
||||
final resumeDialogue = state.hasResumableLessonDialogue;
|
||||
final stageStep = !resumeDialogue && !isReview && state.allLessonsComplete
|
||||
? _stageStep()
|
||||
: null;
|
||||
final primaryTitle = resumeDialogue
|
||||
? '继续第 ${activeLesson.number} 课的课程对话'
|
||||
: isReview
|
||||
? '先复习 $count 项'
|
||||
: '第 ${activeLesson.number} 课 · ${activeLesson.title}${activeLesson.segments.length > 1 ? ' · 第 $activeSegment/${activeLesson.segments.length} 段' : ''}';
|
||||
: stageStep?.title ??
|
||||
'第 ${activeLesson.number} 课 · ${activeLesson.title}${activeLesson.segments.length > 1 ? ' · 第 $activeSegment/${activeLesson.segments.length} 段' : ''}';
|
||||
final primaryNote = resumeDialogue
|
||||
? '已保留你的对话进度和提示状态。'
|
||||
: isReview
|
||||
? (state.reviewBacklog ? '有积压项目;先花几分钟清掉到期复习。' : '昨天练过的关键句,今天换个情境再用一次。')
|
||||
: '预热词汇 → 听说读写 → 对话 → 独立尝试';
|
||||
: stageStep?.note ?? '预热词汇 → 听说读写 → 对话 → 独立尝试';
|
||||
final scene = state.recommendedScene;
|
||||
|
||||
return AppPage(
|
||||
child: SpacedColumn(
|
||||
@@ -80,7 +89,9 @@ class HomePage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
isReview ? '${(count * 2).clamp(2, 10)} 分钟' : '12 分钟',
|
||||
isReview
|
||||
? '${(count * 2).clamp(2, 10)} 分钟'
|
||||
: stageStep?.minutes ?? '12 分钟',
|
||||
style: const TextStyle(color: AppColors.green),
|
||||
),
|
||||
],
|
||||
@@ -94,10 +105,10 @@ class HomePage extends StatelessWidget {
|
||||
? '继续对话'
|
||||
: isReview
|
||||
? '开始复习'
|
||||
: '开始今天的学习',
|
||||
: stageStep?.action ?? '开始今天的学习',
|
||||
onPressed: resumeDialogue
|
||||
? onResumeLessonDialogue
|
||||
: onStartPrimaryTask,
|
||||
: stageStep?.onPressed ?? onStartPrimaryTask,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -110,7 +121,7 @@ class HomePage extends StatelessWidget {
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
||||
),
|
||||
Text(
|
||||
'初次见面 · 4 个任务 · 文字或语音输入',
|
||||
'${scene.title} · ${scene.script.prompts.length} 个任务 · 文字或语音输入',
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
SecondaryButton(label: '开始情境对话', onPressed: onOpenDialogue),
|
||||
@@ -122,6 +133,56 @@ class HomePage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// What comes after the last A0 lesson: consolidation until the core items
|
||||
/// are ready, then the stage assessment, then waiting for A1 content.
|
||||
_StageStep _stageStep() {
|
||||
final usable =
|
||||
'可使用 ${state.coreUsableCount}/48 · 已掌握 ${state.coreMasteredCount}/30';
|
||||
if (state.a0Passed) {
|
||||
return _StageStep(
|
||||
title: 'A0 已通过',
|
||||
note: 'A1 课程准备中。先用巩固练习和情境对话保持手感。',
|
||||
action: '安排一题巩固练习',
|
||||
minutes: '3 分钟',
|
||||
onPressed: onStartReinforcement,
|
||||
);
|
||||
}
|
||||
final packId = state.nextAssessmentPackId;
|
||||
if (state.a0AssessmentReady && packId != null) {
|
||||
return _StageStep(
|
||||
title: 'A0 阶段评估 · $packId',
|
||||
note: '$usable。可以开始阶段评估,两套评估间隔至少 24 小时。',
|
||||
action: '开始阶段评估',
|
||||
minutes: '15 分钟',
|
||||
onPressed: () => onOpenAssessment(packId),
|
||||
);
|
||||
}
|
||||
return _StageStep(
|
||||
title: state.a0AssessmentReady ? '第二套评估 24 小时后开放' : 'A0 课程已学完',
|
||||
note: state.a0AssessmentReady
|
||||
? '第一套评估已通过。等待期间继续巩固。'
|
||||
: '$usable。继续按时复习、做情境对话,达到要求后开放阶段评估。',
|
||||
action: '安排一题巩固练习',
|
||||
minutes: '3 分钟',
|
||||
onPressed: onStartReinforcement,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _StageStep {
|
||||
const _StageStep({
|
||||
required this.title,
|
||||
required this.note,
|
||||
required this.action,
|
||||
required this.minutes,
|
||||
required this.onPressed,
|
||||
});
|
||||
final String title;
|
||||
final String note;
|
||||
final String action;
|
||||
final String minutes;
|
||||
final VoidCallback onPressed;
|
||||
}
|
||||
|
||||
class _FrameworkNote extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user