|
@@ -265,11 +265,13 @@ class IntelligentExamController extends Controller
|
|
|
$totalScore = array_sum(array_column($questions, 'score'));
|
|
$totalScore = array_sum(array_column($questions, 'score'));
|
|
|
|
|
|
|
|
// 第二步:保存试卷到数据库(同步)
|
|
// 第二步:保存试卷到数据库(同步)
|
|
|
|
|
+ // 【修复】策略可能修改assembleType(如章节智能组卷检测到全部掌握后转为下一章节摸底)
|
|
|
|
|
+ $finalAssembleType = ($result !== null && isset($result['assemble_type'])) ? $result['assemble_type'] : $assembleType;
|
|
|
$paperId = $this->questionBankService->saveExamToDatabase([
|
|
$paperId = $this->questionBankService->saveExamToDatabase([
|
|
|
'paper_name' => $paperName,
|
|
'paper_name' => $paperName,
|
|
|
'student_id' => $data['student_id'],
|
|
'student_id' => $data['student_id'],
|
|
|
'teacher_id' => $data['teacher_id'] ?? null,
|
|
'teacher_id' => $data['teacher_id'] ?? null,
|
|
|
- 'assembleType' => $assembleType,
|
|
|
|
|
|
|
+ 'assembleType' => $finalAssembleType,
|
|
|
'difficulty_category' => $difficultyCategory,
|
|
'difficulty_category' => $difficultyCategory,
|
|
|
'total_score' => $totalScore, // 使用计算后的实际总分
|
|
'total_score' => $totalScore, // 使用计算后的实际总分
|
|
|
'questions' => $questions,
|
|
'questions' => $questions,
|