MistakeBook

错题本 · 诊断与重练

完全复用上传卷子/智能出卷的师生联动:先选老师,再选学生,再刷新数据。

{{-- 选择老师(老师登录时隐藏) --}} @if(!$this->isTeacher)
@endif
按照上传卷子/智能出卷同款逻辑联动师生
@if ($actionMessage)
{{ $actionMessage }}
@endif @if ($errorMessage)

加载失败

{{ $errorMessage }}
@endif

总错题

{{ $summary['total'] ?? 0 }}

7d

本周错题

{{ $summary['this_week'] ?? 0 }}

待复习

{{ $summary['pending_review'] ?? 0 }}

AI

掌握率

@php $masteryRate = $summary['mastery_rate'] ?? null; @endphp

{{ $masteryRate !== null ? number_format($masteryRate * 100, 1) . '%' : '--' }}

多维筛选

@php $selectedKps = $filters['kp_ids'] ?? []; $skillOptions = collect($filterOptions['skills'] ?? []) ->when(!empty($selectedKps), function($c) use ($selectedKps) { return $c->filter(fn($item) => empty($item['kp_code']) || in_array($item['kp_code'], $selectedKps)); }) ->values() ->all(); @endphp

错误类型

@foreach(['计算错误', '概念错误', '方法错误', '审题错误', '表达错误'] as $type) @endforeach

时间范围

@if($filters['time_range'] === 'custom')
@endif

推荐补救路径

@if(!empty($patterns['recommend_path']))
    @foreach($patterns['recommend_path'] as $step)
  • {{ $step['title'] ?? ($step['kp'] ?? '学习步骤') }} @if(!empty($step['description']))

    {{ $step['description'] }}

    @endif

  • @endforeach
@else

暂无推荐路径,稍后重试

@endif

错题列表

题干、作答、AI 解析与操作

已选 {{ count($selectedMistakeIds) }} / {{ count($mistakes) }}
@if ($isLoading)
正在加载错题...
@elseif(empty($mistakes))

暂无错题,先选择老师和学生

@else
@foreach($mistakes as $mistake)

{{ $mistake['id'] ?? 'ID' }}

{{ $mistake['created_at'] ?? '' }}

@foreach(($mistake['kp_ids'] ?? []) as $kp) KP {{ $kp }} @endforeach @foreach(($mistake['skill_ids'] ?? []) as $skill) {{ $skill }} @endforeach @if(!empty($mistake['error_type'])) {{ $mistake['error_type'] }} @endif @if(isset($mistake['correct'])) {{ $mistake['correct'] ? '已掌握' : '错误' }} @endif @if(!empty($mistake['reviewed'])) 已复习 @endif @if(!empty($mistake['favorite'])) 已收藏 @endif

题干

学生作答

{{ $mistake['student_answer'] ?? '无' }}

正确答案

{{ $mistake['question']['answer'] ?? ($mistake['correct_answer'] ?? '未知') }}

错误类型

{{ $mistake['error_type'] ?? '未分类' }}

错误原因分析

{{ $mistake['ai_analysis']['reason'] ?? $mistake['ai_analysis'] ?? '暂无分析' }}

对应技能

{{ $mistake['ai_analysis']['skill'] ?? ($mistake['skill_desc'] ?? '未识别') }}

正确解法

{{ $mistake['ai_analysis']['solution'] ?? '可向AI请求解析' }}

避免类似错误

{{ $mistake['ai_analysis']['tip'] ?? ($mistake['ai_analysis']['suggestion'] ?? '加强审题与演算步骤复查') }}

@if(!empty($relatedQuestions[$mistake['id'] ?? ''] ?? []))

关联题目

@foreach($relatedQuestions[$mistake['id']] as $related)

ID: {{ $related['id'] ?? '' }}

{{ $related['stem'] ?? $related['content'] ?? '相关题目' }}

难度: {{ $related['difficulty'] ?? '中等' }} @if(!empty($related['kp_codes'])) · KP: {{ is_array($related['kp_codes']) ? implode(',', $related['kp_codes']) : $related['kp_codes'] }} @endif

@endforeach
@endif
@endforeach
@endif
@if(!empty($recommendations))

重练题单

基于错题推荐的新题,支持导出

打开题库
@foreach($recommendations as $rec)

题目 ID: {{ $rec['id'] ?? '' }}

{{ $rec['stem'] ?? $rec['content'] ?? '推荐题目' }}

@if(!empty($rec['kp_codes'])) KP {{ is_array($rec['kp_codes']) ? implode(',', $rec['kp_codes']) : $rec['kp_codes'] }} @endif @if(!empty($rec['skills'])) {{ is_array($rec['skills']) ? implode(',', $rec['skills']) : $rec['skills'] }} @endif
@endforeach
@endif

智能分析

错误类型雷达图 · 弱点技能排名 · 薄弱知识点

@if(!empty($patterns['error_types']))

错误类型雷达图

AI
@endif @if(!empty($patterns['top_skills']))

弱点技能排名

Top
@endif
@if(!empty($patterns['top_kps']))

薄弱知识点热力

@foreach(($patterns['top_kps'] ?? []) as $kp)
{{ $kp['name'] ?? ($kp['kp'] ?? $kp['kp_code'] ?? '知识点') }} 错误 {{ $kp['count'] ?? $kp['mistake_count'] ?? 0 }}
@php $score = ($kp['score'] ?? $kp['accuracy'] ?? 0); if ($score > 1) $score = $score / 100; $width = max(10, min(100, (1 - (float) $score) * 100)); @endphp
@endforeach
@endif
@push('scripts') @endpush