整个课程和数据UI重新设计版本
This commit is contained in:
@@ -4,7 +4,9 @@ import '../../core/app_state.dart';
|
||||
import '../../core/ai_service.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import '../../core/models.dart';
|
||||
import '../../core/seed_courses.dart';
|
||||
import '../../core/courses/courses.dart';
|
||||
import '../../core/courses/course_pack.dart';
|
||||
import '../../core/courses/course_repository.dart';
|
||||
import '../../core/speech_compare.dart';
|
||||
import '../../core/voice_service.dart';
|
||||
import '../../core/writing_feedback.dart';
|
||||
@@ -14,6 +16,7 @@ import '../../widgets/voice_answer.dart';
|
||||
|
||||
part 'steps/independent_step.dart';
|
||||
part 'steps/listening_step.dart';
|
||||
part 'steps/material_step.dart';
|
||||
part 'steps/preview_step.dart';
|
||||
part 'steps/reading_step.dart';
|
||||
part 'steps/speaking_step.dart';
|
||||
@@ -53,10 +56,10 @@ class _LessonFlowState extends State<LessonFlow> {
|
||||
}
|
||||
|
||||
LessonActivity get activity =>
|
||||
activityBySegmentId(segment.id, widget.state.activeLessonId);
|
||||
activityBySegmentId(segment.id);
|
||||
|
||||
List<VocabularyItem> get previewItems =>
|
||||
vocabularyBySegmentId(segment.id, widget.state.activeLessonId);
|
||||
vocabularyBySegmentId(segment.id);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -155,6 +158,16 @@ class _LessonFlowState extends State<LessonFlow> {
|
||||
),
|
||||
onContinue: widget.state.completeReading,
|
||||
);
|
||||
case LessonStep.material:
|
||||
content = _MaterialStep(
|
||||
state: widget.state,
|
||||
materials:
|
||||
CourseRepository.instance
|
||||
.unitById(widget.state.activeLessonId)
|
||||
?.materials ??
|
||||
const [],
|
||||
onContinue: widget.state.completeMaterial,
|
||||
);
|
||||
case LessonStep.writing:
|
||||
content = _WritingStep(
|
||||
state: widget.state,
|
||||
@@ -180,6 +193,7 @@ class _LessonFlowState extends State<LessonFlow> {
|
||||
case LessonStep.independent:
|
||||
content = _IndependentStep(
|
||||
state: widget.state,
|
||||
lessonId: lesson.id,
|
||||
segmentId: segment.id,
|
||||
keepRecording: widget.state.keepRecordings,
|
||||
activity: activity,
|
||||
@@ -199,9 +213,9 @@ class _LessonFlowState extends State<LessonFlow> {
|
||||
initialText: activity.independentPrompt,
|
||||
);
|
||||
},
|
||||
onContinue: (spoken, recordingPath) =>
|
||||
onContinue: (spoken, recordingPath, aiCorrected) =>
|
||||
widget.state.completeIndependentAttempt(
|
||||
assisted: showIndependentHelp,
|
||||
assisted: showIndependentHelp || aiCorrected,
|
||||
spoken: spoken,
|
||||
rawAnswer: independentController.text.trim(),
|
||||
recordingPath: recordingPath,
|
||||
|
||||
Reference in New Issue
Block a user