试卷评分

{{-- 试卷基本信息 --}}
试卷名称: {{ $paperName ?? '未知' }}
班级: {{ $paperClass ?? '未知' }}
学生: {{ $paperStudent ?? '未知' }}
考试日期: {{ $paperDate ?? '未知' }}
{{-- 评分列表 --}} @if(!empty($questions))
@foreach($questions as $index => $question)
第 {{ $question['question_number'] ?? ($index + 1) }} 题 {{ ($question['question_type'] ?? '未知') }} ({{ $question['score'] ?? 0 }} 分)
{{-- 题目内容 --}}

{{ $question['content'] ?? $question['question_text'] ?? '' }}

{{-- 选择题选项 --}} @if(($question['question_type'] ?? '') === 'choice' && !empty($question['options']))
@foreach($question['options'] as $option)
{{ $option['key'] ?? '' }}. {{ $option['value'] ?? '' }}
@endforeach
@endif
{{-- 参考答案 --}}

参考答案

@if(!empty($question['answer']))

{{ $question['answer'] }}

@else

⚠️ 未找到参考答案

@endif
{{-- 评分操作区 --}}
@if($question['question_type'] === 'choice') {{-- 选择题评分 --}}
评分:
@if(($gradingData[$index]['is_correct'] ?? null) !== null) 当前:{{ ($gradingData[$index]['is_correct'] ?? false) ? '正确' : '错误' }} ({{ ($gradingData[$index]['is_correct'] ?? false) ? ($question['score'] ?? 0) : 0 }} 分) @endif
@else {{-- 填空题/解答题评分 --}}
得分:
/ {{ $question['score'] ?? 0 }} 分
@if(($gradingData[$index]['score'] ?? null) !== null) @php $score = $gradingData[$index]['score'] ?? 0; $maxScore = $question['score'] ?? 0; $isCorrect = $score >= $maxScore; @endphp ({{ $isCorrect ? '完全正确' : '部分得分' }}:{{ number_format(($score / $maxScore) * 100, 1) }}%) @endif
@endif
@endforeach
{{-- 提交按钮 --}}
@else

暂无题目数据

@endif