学情报告
卷子:{{ $paper['name'] ?? '-' }} | 学生:{{ $student['name'] ?? '-' }}({{ $student['id'] ?? '' }})
年级:{{ $student['grade'] ?? '-' }} | 班级:{{ $student['class'] ?? '-' }}
平均掌握度 {{ isset($mastery['average']) ? number_format($mastery['average'] * 100, 1) . '%' : '无数据' }}
题目数:{{ is_array($questions ?? null) ? count($questions) : ($paper['total_questions'] ?? '-') }}
知识点掌握度
@if(!empty($mastery['items']))
@foreach($mastery['items'] as $item)
@php
$pct = min(100, max(0, $item['mastery_level'] * 100));
$barColor = $pct >= 80 ? '#10b981' : ($pct >= 60 ? '#f59e0b' : '#ef4444');
$delta = $item['mastery_change'] ?? null;
@endphp
{{ $item['kp_name'] }} ({{ $item['kp_code'] ?? '-' }})
{{ number_format($pct, 1) }}%
@if($delta !== null)
{{ $delta > 0 ? '↑' : ($delta < 0 ? '↓' : '→') }} {{ number_format(abs($delta) * 100, 1) }}%
@endif
@endforeach
@else
暂无掌握度数据
@endif
解题思路与题目表现
@php
$insightMap = [];
foreach (($question_insights ?? []) as $insight) {
$no = $insight['question_number'] ?? $insight['question_id'] ?? null;
if ($no !== null) {
$insightMap[$no] = $insight;
}
}
@endphp
@foreach($questions as $q)
@php
$insight = $insightMap[$q['question_number']] ?? ($insightMap[$q['display_number'] ?? null] ?? []);
$score = $insight['score'] ?? ($insight['student_score'] ?? null);
$fullScore = $insight['full_score'] ?? ($q['score'] ?? null);
$analysisRaw = $insight['analysis']
?? $insight['thinking_process']
?? $insight['feedback']
?? $insight['suggestions']
?? $insight['reason']
?? ($insight['correct_solution'] ?? null);
// 若有下一步建议,追加
if (empty($analysisRaw) && !empty($insight['next_steps'])) {
$analysisRaw = '后续建议:' . (is_array($insight['next_steps']) ? implode(';', $insight['next_steps']) : $insight['next_steps']);
}
$analysis = is_array($analysisRaw) ? json_encode($analysisRaw, JSON_UNESCAPED_UNICODE) : $analysisRaw;
if ($analysis === null || $analysis === '') {
$analysis = '暂无解题思路,待补充';
}
$stepsRaw = $insight['steps'] ?? $insight['solution_steps'] ?? $insight['analysis_steps'] ?? null;
$steps = [];
if (is_array($stepsRaw)) {
$steps = $stepsRaw;
} elseif (is_string($stepsRaw) && trim($stepsRaw) !== '') {
$steps = preg_split('/[\r\n]+/', trim($stepsRaw));
}
$isCorrect = $insight['is_correct'] ?? $insight['correct'] ?? null;
$badgeColor = $isCorrect === true ? '#10b981' : ($isCorrect === false ? '#ef4444' : '#6b7280');
$badgeText = $isCorrect === true ? '答对' : ($isCorrect === false ? '答错' : '待判');
$typeMap = ['choice' => '选择题', 'fill' => '填空题', 'answer' => '解答题'];
$typeLabel = $typeMap[$q['question_type'] ?? ''] ?? ($q['question_type'] ?? '题型未标注');
$questionText = is_string($q['question_text']) ? $q['question_text'] : json_encode($q['question_text'], JSON_UNESCAPED_UNICODE);
$solution = $q['solution'] ?? null;
@endphp
题号 {{ $q['display_number'] ?? $q['question_number'] }}
{{ $q['knowledge_point_name'] ?? $q['knowledge_point'] ?? '-' }}
{{ $badgeText }}
@if($score !== null && $fullScore !== null)
得分 {{ $score }} / {{ $fullScore }}
@else
待评分
@endif
{!! $questionText !!}
题型:{{ $typeLabel }}
{!! nl2br(e($analysis ?? '暂无解题思路记录')) !!}
@if(!empty($steps))
解题步骤
@foreach($steps as $s)
- {!! nl2br(e(is_array($s) ? json_encode($s, JSON_UNESCAPED_UNICODE) : $s)) !!}
@endforeach
@elseif(!empty($solution))
题库解析
{!! is_array($solution) ? json_encode($solution, JSON_UNESCAPED_UNICODE) : $solution !!}
@endif
@endforeach
整体分析
@php
$overallRaw = $analysis_data['summary'] ?? $analysis_data['overall_feedback'] ?? null;
$overall = is_array($overallRaw) ? json_encode($overallRaw, JSON_UNESCAPED_UNICODE) : $overallRaw;
@endphp
@if($overall)
{!! nl2br(e($overall)) !!}
@elseif(!empty($analysis_data['summary']))
{!! nl2br(e(json_encode($analysis_data['summary'], JSON_UNESCAPED_UNICODE))) !!}
@elseif(!empty($analysis_data))
{!! nl2br(e(json_encode($analysis_data, JSON_UNESCAPED_UNICODE))) !!}
@else
暂无整体分析,待分析服务返回后呈现。
@endif