|
@@ -421,7 +421,29 @@ class DiagnosticChapterService
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Log::warning('DiagnosticChapterService: 指定章节及同教材章节均无可用未摸底章节', [
|
|
|
|
|
|
|
+ // 与普通摸底逻辑保持一致:全教材都摸底后重启,返回第一章
|
|
|
|
|
+ $firstChapter = $chaptersInTextbook->first();
|
|
|
|
|
+ if ($firstChapter) {
|
|
|
|
|
+ $chapterData = $this->getChapterKnowledgePointsSimple((int) $firstChapter->id);
|
|
|
|
|
+ $kpCodesWithQuestions = $this->filterKpCodesWithQuestions($chapterData['kp_codes']);
|
|
|
|
|
+
|
|
|
|
|
+ Log::info('DiagnosticChapterService: 指定章节及同教材已摸底完成,重启到第一章', [
|
|
|
|
|
+ 'textbook_id' => $anchorTextbookId,
|
|
|
|
|
+ 'student_id' => $studentId,
|
|
|
|
|
+ 'target_chapter_ids' => $targetChapterIds,
|
|
|
|
|
+ 'chapter_id' => $firstChapter->id,
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ return [
|
|
|
|
|
+ 'chapter_id' => $firstChapter->id,
|
|
|
|
|
+ 'chapter_name' => $firstChapter->name ?? $firstChapter->title ?? '',
|
|
|
|
|
+ 'section_ids' => $chapterData['section_ids'],
|
|
|
|
|
+ 'kp_codes' => $kpCodesWithQuestions,
|
|
|
|
|
+ 'is_restart' => true,
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Log::warning('DiagnosticChapterService: 指定章节所属教材无章节可用于重启', [
|
|
|
'textbook_id' => $anchorTextbookId,
|
|
'textbook_id' => $anchorTextbookId,
|
|
|
'student_id' => $studentId,
|
|
'student_id' => $studentId,
|
|
|
'target_chapter_ids' => $targetChapterIds,
|
|
'target_chapter_ids' => $targetChapterIds,
|