|
|
@@ -70,11 +70,11 @@ class ExamAnswerAnalysisService
|
|
|
$hasAnswerChanged = (bool) ($recordChangeState['steps_changed'] ?? false)
|
|
|
|| (bool) ($recordChangeState['questions_changed'] ?? false);
|
|
|
if ($hasAnswerChanged) {
|
|
|
- Log::warning('ExamAnswerAnalysisService: 在线题目难度校准已移至PDF生成后异步执行', [
|
|
|
+ Log::warning('ExamAnswerAnalysisService: 在线题目难度校准已移至非关键路径异步执行', [
|
|
|
'paper_id' => $paperId,
|
|
|
'student_id' => $studentId,
|
|
|
'question_count' => count($questions),
|
|
|
- 'queue' => 'pdf',
|
|
|
+ 'queue' => config('queue.workloads.question_difficulty_calibration', 'default'),
|
|
|
]);
|
|
|
} else {
|
|
|
Log::info('ExamAnswerAnalysisService: 本次答案无变化,跳过在线难度更新', [
|
|
|
@@ -1845,17 +1845,23 @@ class ExamAnswerAnalysisService
|
|
|
]);
|
|
|
|
|
|
if (! empty($difficultyCalibrationQuestions)) {
|
|
|
+ $calibrationDelaySeconds = max(
|
|
|
+ 0,
|
|
|
+ (int) config('queue.workloads.question_difficulty_calibration_delay_seconds', 30)
|
|
|
+ );
|
|
|
+
|
|
|
dispatch(new \App\Jobs\ProcessQuestionDifficultyCalibrationJob(
|
|
|
$paperId,
|
|
|
$studentId,
|
|
|
$difficultyCalibrationQuestions
|
|
|
- ));
|
|
|
+ ))->delay(now()->addSeconds($calibrationDelaySeconds));
|
|
|
|
|
|
- Log::warning('在线题目难度校准任务已加入队列(PDF生成后执行)', [
|
|
|
+ Log::warning('在线题目难度校准任务已加入延迟队列', [
|
|
|
'student_id' => $studentId,
|
|
|
'paper_id' => $paperId,
|
|
|
'question_count' => count($difficultyCalibrationQuestions),
|
|
|
- 'queue' => 'pdf',
|
|
|
+ 'queue' => config('queue.workloads.question_difficulty_calibration', 'default'),
|
|
|
+ 'delay_seconds' => $calibrationDelaySeconds,
|
|
|
]);
|
|
|
}
|
|
|
} catch (\Exception $e) {
|