|
@@ -237,6 +237,19 @@ class ExamPdfExportService
|
|
|
'recommendations_count' => count($templateData['recommendations'] ?? []),
|
|
'recommendations_count' => count($templateData['recommendations'] ?? []),
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
|
|
+ // 【重要】处理题目数据中的图片标签和公式
|
|
|
|
|
+ // 将 <image src="..."/> 转换为 <img src="..." />,并处理公式
|
|
|
|
|
+ if (! empty($templateData['questions'])) {
|
|
|
|
|
+ foreach ($templateData['questions'] as $idx => $question) {
|
|
|
|
|
+ $templateData['questions'][$idx] = MathFormulaProcessor::processQuestionData($question);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (! empty($templateData['question_insights'])) {
|
|
|
|
|
+ foreach ($templateData['question_insights'] as $idx => $insight) {
|
|
|
|
|
+ $templateData['question_insights'][$idx] = MathFormulaProcessor::processQuestionData($insight);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 渲染HTML
|
|
// 渲染HTML
|
|
|
$html = view('exam-analysis.pdf-report', $templateData)->render();
|
|
$html = view('exam-analysis.pdf-report', $templateData)->render();
|
|
|
if (! $html) {
|
|
if (! $html) {
|