{{-- 页面标题区域 --}}

错题本

查看学生错题记录与AI分析,生成针对性练习

{{-- 选择器区域 --}}
@if(!$this->isTeacher)
@endif
{{-- 错误提示 --}} @if ($errorMessage)

加载错误

{{ $errorMessage }}

@endif @if ($actionMessage)

{{ $actionMessage }}

@endif {{-- 学习状态概览 --}}
{{-- 今日必复习 --}}

今日必复习

{{ count($mistakes) }} 道错题
@php $urgentMistakes = collect($mistakes)->take(3); @endphp @if($urgentMistakes->isNotEmpty()) @foreach($urgentMistakes as $mistake) @php $daysSince = $mistake['created_at'] ? \Carbon\Carbon::parse($mistake['created_at'])->diffInDays(now()) : 0; $urgency = $daysSince > 7 ? 'high' : ($daysSince > 3 ? 'medium' : 'low'); @endphp
@php $hasValidInfo = false; $tags = []; @endphp @if(!empty($mistake['question']['question_number'])) @php $hasValidInfo = true; $tags[] = '第' . $mistake['question']['question_number'] . '题'; @endif @if(!empty($mistake['question']['kp_code'])) @php $hasValidInfo = true; $kpName = $knowledgePointOptions[$mistake['question']['kp_code']] ?? $mistake['question']['kp_code']; if($kpName && $kpName !== $mistake['question']['kp_code']) { $tags[] = $kpName; } @endif @if(!empty($mistake['error_type'])) @php $hasValidInfo = true; $tags[] = $mistake['error_type']; @endif @if($hasValidInfo && !empty($tags))
@foreach($tags as $tag) {{ $tag }} @endforeach
@endif

{{ $mistake['question']['stem'] ?? '暂无题干' }}

@endforeach @else

暂无错题数据

请先选择学生并刷新数据

@endif
@if($urgentMistakes->isNotEmpty())
@endif
{{-- 学习进度 --}}

学习进度

整体掌握度 基于所有知识点平均
@php $masteryRate = $summary['mastery_rate'] ?? 0; $masteryPercentage = $masteryRate * 100; @endphp

{{ number_format($masteryPercentage, 0) }}%

待复习知识点 {{ $summary['pending_review'] ?? 0 }}
总错题数 {{ $summary['total'] ?? 0 }}
本周新增 {{ $summary['this_week'] ?? 0 }}
{{-- 加载状态 --}} @if ($isLoading)

正在加载数据,请稍候...

@else {{-- 主内容区域 --}}
{{-- 左侧筛选 --}}

筛选条件

@if(!empty($filters['error_types']) || !empty($filters['kp_ids']) || !empty($filters['skill_ids'])) @endif
{{-- 快速排序 --}}
{{-- 正确与否筛选 --}}
{{-- 状态筛选 --}}
{{-- 时间范围 --}}
{{-- 错误类型 --}}
@foreach(['计算错误', '概念错误', '方法错误', '审题错误', '步骤缺失', '书写不规范'] as $type) @endforeach
{{-- 右侧错题列表 --}}
{{-- 错题列表 --}}

错题列表 ({{ $total }})

@if(!empty($selectedMistakeIds))
@endif @if(!empty($mistakes) && empty($selectedMistakeIds)) @endif
@if(empty($mistakes))

暂无错题数据

请先选择学生后刷新数据

@else
@foreach($mistakes as $mistake) @php $urgency = 'normal'; if($mistake['created_at']) { $daysSince = \Carbon\Carbon::parse($mistake['created_at'])->diffInDays(now()); $urgency = $daysSince > 7 ? 'high' : ($daysSince > 3 ? 'medium' : 'low'); } @endphp
{{-- 错题卡片头部 - 紧凑布局 --}}
{{-- 复选框和紧急度指示器 --}}
@if($urgency !== 'normal') @endif
{{-- 主要信息区域 --}}
#{{ $mistake['id'] ?? '' }} @if(!empty($mistake['question']['question_number'])) 第{{ $mistake['question']['question_number'] }}题 @endif
@php $createdAt = $mistake['created_at'] ?? null; if ($createdAt) { try { $date = \Carbon\Carbon::parse($createdAt); echo '' . $date->diffForHumans() . ''; } catch (\Exception $e) { echo '' . $createdAt . ''; } } @endphp
@if(!empty($mistake['question']['stem']))

{{ \Illuminate\Support\Str::limit(strip_tags($mistake['question']['stem']), 150) }}

@endif
@if(!empty($mistake['question']['kp_code'])) {{ $knowledgePointOptions[$mistake['question']['kp_code']] ?? $mistake['question']['kp_code'] }} @endif @if(!empty($mistake['error_type'])) {{ $mistake['error_type'] }} @endif @if(!empty($mistake['mistake_category'])) {{ $mistake['mistake_category'] }} @endif @php $skillIds = $mistake['skill_ids'] ?? []; if (is_array($skillIds) && !empty($skillIds)) { $validSkills = array_filter($skillIds, function($id) { return $id && $id !== '无' && $id !== 'none' && $id !== null; }); if (!empty($validSkills)) { foreach(array_slice($validSkills, 0, 2) as $skillId): ?> {{ $skillId }} @php endforeach; } } ?>
@if(!empty($mistake['student_answer']) && trim($mistake['student_answer']) !== '' && trim($mistake['student_answer']) !== '未作答')

你的答案

{{ $mistake['student_answer'] }}

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

正确答案

{{ $mistake['question']['answer'] }}

@endif
@if(!empty($mistake['ai_analysis']['reason']))

AI分析

{{ $mistake['ai_analysis']['reason'] }}

@endif
查看详情与操作
@if(!empty($mistake['question']['stem']))

完整题干

@endif @if(!empty($mistake['question']['solution']))

解题步骤

{{ $mistake['question']['solution'] }}
@endif @if(!empty($mistake['ai_analysis']['solution']) || !empty($mistake['ai_analysis']['suggestions']))

详细分析与建议

@if(!empty($mistake['ai_analysis']['solution']))
解法:

{{ $mistake['ai_analysis']['solution'] }}

@endif @if(!empty($mistake['ai_analysis']['suggestions']))
建议:

{{ $mistake['ai_analysis']['suggestions'] }}

@endif
@endif
@if(!empty($mistake['answer_area_crop_path'])) 查看原始图片 @endif
@if(!empty($relatedQuestions[$mistake['id'] ?? ''] ?? []))

推荐练习

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

{{ $related['stem'] ?? '题目' }}

@if(!empty($related['difficulty'])) {{ $related['difficulty'] === 'easy' ? '简单' : ($related['difficulty'] === 'medium' ? '中等' : '困难') }} @endif
@endforeach
@endif
@endforeach
{{-- 分页 --}} @php $maxPage = (int) ceil($total / $perPage); @endphp @if($maxPage > 1)
共 {{ $total }} 条,第 {{ $page }}/{{ $maxPage }} 页
@for($i = max(1, $page - 2); $i <= min($maxPage, $page + 2); $i++) @endfor
@endif @endif
{{-- 推荐练习题 --}} @if(!empty($recommendations))

推荐练习题 ({{ count($recommendations) }})

@foreach($recommendations as $rec)

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

@if(!empty($rec['kp_codes'])) {{ is_array($rec['kp_codes']) ? implode(',', $rec['kp_codes']) : $rec['kp_codes'] }} @endif
@endforeach
@endif {{-- 错误分析与学习建议 --}} @if(!empty($patterns['error_types']) || !empty($patterns['top_kps']))

错误分析与学习建议

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

错误类型分布

@php $totalErrors = collect($patterns['error_types'])->sum('count'); @endphp @foreach($patterns['error_types'] as $et) @php $count = $et['count'] ?? 0; $percentage = $totalErrors > 0 ? ($count / $totalErrors * 100) : 0; @endphp
{{ $et['type'] ?? '未知错误' }} {{ $count }}次 ({{ number_format($percentage, 0) }}%)
@endforeach
@endif @if(!empty($patterns['top_kps']))

薄弱知识点

@php $maxMistakes = collect($patterns['top_kps'])->max('mistake_count') ?: 1; @endphp @foreach($patterns['top_kps'] as $kp) @php $count = $kp['mistake_count'] ?? 0; $width = ($count / $maxMistakes) * 100; @endphp
{{ $kp['name'] ?? $kp['kp_code'] ?? '知识点' }} {{ $count }}题
@endforeach
@endif
@endif

学习建议

1

优先复习高错频知识点

集中练习错误次数最多的3个知识点

2

制定复习计划

建议每天复习5-10道错题,形成规律

3

重点突破错误类型

针对主要错误类型进行专项练习

4

定期回顾与测试

每周回顾本周错题,检验掌握程度

@endif
@endif