|
@@ -6,6 +6,8 @@
|
|
|
|
|
|
|
|
// 是否在题干后显示题目ID (Q000123)
|
|
// 是否在题干后显示题目ID (Q000123)
|
|
|
$showQuestionId = config('exam.show_question_id_in_pdf', false);
|
|
$showQuestionId = config('exam.show_question_id_in_pdf', false);
|
|
|
|
|
+ // 是否在题号后显示题目难度(用于校验排序)
|
|
|
|
|
+ $showQuestionDifficulty = config('exam.show_question_difficulty_in_pdf', false);
|
|
|
// 判卷模式是否显示题目题干与选项,默认显示;可通过 EXAM_PDF_GRADING_SHOW_STEM 关闭
|
|
// 判卷模式是否显示题目题干与选项,默认显示;可通过 EXAM_PDF_GRADING_SHOW_STEM 关闭
|
|
|
$showGradingStem = config('exam.pdf_grading_show_stem', true);
|
|
$showGradingStem = config('exam.pdf_grading_show_stem', true);
|
|
|
|
|
|
|
@@ -15,6 +17,12 @@
|
|
|
return '(Q' . str_pad($id, 6, '0', STR_PAD_LEFT) . ')';
|
|
return '(Q' . str_pad($id, 6, '0', STR_PAD_LEFT) . ')';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ $formatDifficulty = function($difficulty) {
|
|
|
|
|
+ if ($difficulty === null || $difficulty === '') return '';
|
|
|
|
|
+ $value = (float) $difficulty;
|
|
|
|
|
+ return sprintf('[%.2f]', $value);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 【新增】动态计算大题号 - 根据有题目的题型分配序号
|
|
// 【新增】动态计算大题号 - 根据有题目的题型分配序号
|
|
|
$sectionNumbers = [
|
|
$sectionNumbers = [
|
|
|
'choice' => null,
|
|
'choice' => null,
|
|
@@ -198,6 +206,9 @@
|
|
|
<span class="question-stem">{!! $renderedStem !!}</span>
|
|
<span class="question-stem">{!! $renderedStem !!}</span>
|
|
|
@if($showQuestionId && !empty($q->id))
|
|
@if($showQuestionId && !empty($q->id))
|
|
|
<span class="question-id" style="font-size:10px;color:#999;margin-left:4px;">{!! $formatQuestionId($q->id) !!}</span>
|
|
<span class="question-id" style="font-size:10px;color:#999;margin-left:4px;">{!! $formatQuestionId($q->id) !!}</span>
|
|
|
|
|
+ @if($showQuestionDifficulty)
|
|
|
|
|
+ <span style="font-size:10px;color:#999;margin-left:4px;white-space:nowrap;">{{ $formatDifficulty($q->difficulty ?? null) }}</span>
|
|
|
|
|
+ @endif
|
|
|
@endif
|
|
@endif
|
|
|
</div>
|
|
</div>
|
|
|
@endif
|
|
@endif
|
|
@@ -349,6 +360,9 @@
|
|
|
<span class="question-stem">{!! $renderedContent !!}</span>
|
|
<span class="question-stem">{!! $renderedContent !!}</span>
|
|
|
@if($showQuestionId && !empty($q->id))
|
|
@if($showQuestionId && !empty($q->id))
|
|
|
<span class="question-id" style="font-size:10px;color:#999;margin-left:4px;">{!! $formatQuestionId($q->id) !!}</span>
|
|
<span class="question-id" style="font-size:10px;color:#999;margin-left:4px;">{!! $formatQuestionId($q->id) !!}</span>
|
|
|
|
|
+ @if($showQuestionDifficulty)
|
|
|
|
|
+ <span style="font-size:10px;color:#999;margin-left:4px;white-space:nowrap;">{{ $formatDifficulty($q->difficulty ?? null) }}</span>
|
|
|
|
|
+ @endif
|
|
|
@endif
|
|
@endif
|
|
|
</div>
|
|
</div>
|
|
|
@endif
|
|
@endif
|
|
@@ -407,6 +421,9 @@
|
|
|
<span class="question-score-inline">(本小题满分 {{ $q->score ?? 10 }} 分)
|
|
<span class="question-score-inline">(本小题满分 {{ $q->score ?? 10 }} 分)
|
|
|
@if($showQuestionId && !empty($q->id))
|
|
@if($showQuestionId && !empty($q->id))
|
|
|
<span class="question-id" style="font-size:10px;color:#999;margin-left:4px;">{!! $formatQuestionId($q->id) !!}</span>
|
|
<span class="question-id" style="font-size:10px;color:#999;margin-left:4px;">{!! $formatQuestionId($q->id) !!}</span>
|
|
|
|
|
+ @if($showQuestionDifficulty)
|
|
|
|
|
+ <span style="font-size:10px;color:#999;margin-left:4px;white-space:nowrap;">{{ $formatDifficulty($q->difficulty ?? null) }}</span>
|
|
|
|
|
+ @endif
|
|
|
@endif
|
|
@endif
|
|
|
</span>
|
|
</span>
|
|
|
@endunless
|
|
@endunless
|