|
|
@@ -398,8 +398,11 @@ class DiagnosticChapterService
|
|
|
Log::info('DiagnosticChapterService: 找到当前学习章节', [
|
|
|
'textbook_id' => $textbookId,
|
|
|
'student_id' => $studentId,
|
|
|
+ 'student_id_type' => gettype($studentId),
|
|
|
'chapter_id' => $chapter->id,
|
|
|
+ 'chapter_name' => $chapter->name ?? '',
|
|
|
'has_diagnostic' => $hasDiagnostic,
|
|
|
+ 'kp_codes' => $kpCodes, // 显示实际的知识点列表
|
|
|
'kp_count' => count($kpCodes),
|
|
|
]);
|
|
|
|
|
|
@@ -506,6 +509,14 @@ class DiagnosticChapterService
|
|
|
->pluck('mastery_level', 'kp_code')
|
|
|
->toArray();
|
|
|
|
|
|
+ // 【调试】记录查询到的掌握度
|
|
|
+ Log::info('DiagnosticChapterService: 查询掌握度结果', [
|
|
|
+ 'student_id' => $studentId,
|
|
|
+ 'student_id_type' => gettype($studentId),
|
|
|
+ 'input_kp_codes' => $kpCodes,
|
|
|
+ 'found_levels' => $levels,
|
|
|
+ ]);
|
|
|
+
|
|
|
// 获取每个知识点的题目数量
|
|
|
$questionCounts = \App\Models\Question::query()
|
|
|
->whereIn('kp_code', $kpCodes)
|
|
|
@@ -526,6 +537,14 @@ class DiagnosticChapterService
|
|
|
|
|
|
// 检查是否达标
|
|
|
$level = isset($levels[$kpCode]) ? (float) $levels[$kpCode] : 0.0;
|
|
|
+ $isMastered = $level >= $threshold;
|
|
|
+ Log::info("DiagnosticChapterService: 检查知识点", [
|
|
|
+ 'kp_code' => $kpCode,
|
|
|
+ 'level' => $level,
|
|
|
+ 'threshold' => $threshold,
|
|
|
+ 'is_mastered' => $isMastered,
|
|
|
+ 'level_found_in_db' => isset($levels[$kpCode]),
|
|
|
+ ]);
|
|
|
if ($level >= $threshold) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -547,8 +566,9 @@ class DiagnosticChapterService
|
|
|
|
|
|
Log::info('DiagnosticChapterService: 获取未达标知识点', [
|
|
|
'student_id' => $studentId,
|
|
|
- 'input_kp_count' => count($kpCodes),
|
|
|
- 'result_kp_count' => count($result),
|
|
|
+ 'input_kp_codes' => $kpCodes,
|
|
|
+ 'result_kp_codes' => $result,
|
|
|
+ 'levels_found' => $levels,
|
|
|
'total_questions' => $totalQuestions,
|
|
|
'threshold' => $threshold,
|
|
|
]);
|