|
|
@@ -1039,28 +1039,10 @@ class ExamPdfController extends Controller
|
|
|
|
|
|
// 使用 ExamPdfExportService 构建知识点数据
|
|
|
$pdfService = app(\App\Services\ExamPdfExportService::class);
|
|
|
- // 获取知识点名称映射
|
|
|
- $kpNameMap = [];
|
|
|
- try {
|
|
|
- $kpNameMap = app(\App\Services\QuestionServiceApi::class)->getKnowledgePointOptions();
|
|
|
- } catch (\Throwable $e) {
|
|
|
- // 静默失败,使用 code 作为名称
|
|
|
- }
|
|
|
|
|
|
// 批量获取知识点讲解
|
|
|
- $explanations = $pdfService->buildExplanations($kpCodes);
|
|
|
-
|
|
|
- $knowledgePoints = [];
|
|
|
- foreach ($kpCodes as $kpCode) {
|
|
|
- $kpData = [
|
|
|
- 'kp_code' => $kpCode,
|
|
|
- 'kp_name' => $kpNameMap[$kpCode] ?? $kpCode,
|
|
|
- 'explanation' => $explanations[$kpCode] ?? '',
|
|
|
- ];
|
|
|
-
|
|
|
- $knowledgePoints[] = $kpData;
|
|
|
- }
|
|
|
-
|
|
|
+ $knowledgePoints = $pdfService->buildExplanations($kpCodes);
|
|
|
+info('knowledgePoints'.json_encode($knowledgePoints));
|
|
|
return view('pdf.exam-knowledge-explanation', [
|
|
|
'paperId' => $paper_id,
|
|
|
'examCode' => $examCode ?: $paper_id,
|