@if (empty($this->questionData))

题目不存在

请检查题目ID是否正确

返回上一页
@else {{-- 主要内容区域 --}}
{{-- 左侧:题目内容 --}}
{{-- 题目卡片 --}}
{{-- 题目标识 --}}
@if ($this->sourceType === 'mistake') @php $answeredCorrectly = $this->questionData['mistake_info']['correct'] ?? false; @endphp {{ $answeredCorrectly ? '答题记录' : '错题' }} @else 题库 @endif @if ($this->questionData['question_number'] ?? null) 第{{ $this->questionData['question_number'] }}题 @endif {{ $this->getDifficultyLabel() }}
{{-- 操作按钮 --}}
{{-- 题干 --}}
@php $displayStem = $this->questionData['display_stem'] ?? $this->questionData['stem'] ?? ''; $stemHtml = \App\Services\MathFormulaProcessor::processFormulas($displayStem); @endphp @if (!empty($stemHtml))

题目

{!! $stemHtml !!}
@endif {{-- 标签 --}}
@php $kpCode = $this->questionData['kp_code'] ?? ''; $kpName = $this->getKnowledgePointName(); @endphp @if ($kpCode) {{ $kpName }} @endif @if (!empty($this->questionData['tags'])) @foreach(json_decode($this->questionData['tags'], true) as $tag) {{ $tag }} @endforeach @endif @php $skillNames = $this->getSkillNames(); @endphp @if (!empty($skillNames)) @foreach($skillNames as $skill) {{ $skill }} @endforeach @endif
{{-- 选择题选项(独立呈现,不与题干混排) --}} @php $options = $this->questionData['display_options'] ?? ($this->questionData['options'] ?? []); @endphp @if (!empty($options) && is_array($options))

选项

@php $letters = range('A', 'Z'); @endphp @foreach($options as $idx => $option) @php $label = $letters[$idx] ?? chr(65 + ($idx % 26)); @endphp
{{ $label }}.
{!! $option !!}
@endforeach
@endif {{-- 答案对比(如果是错题) --}} @if ($this->sourceType === 'mistake' && isset($this->questionData['mistake_info']))
@php $answeredCorrectly = $this->questionData['mistake_info']['correct'] ?? false; $studentBg = $answeredCorrectly ? 'bg-green-50' : 'bg-red-50'; $studentText = $answeredCorrectly ? 'text-green-700' : 'text-red-700'; $statusLabel = $answeredCorrectly ? '本次作答正确' : '本次作答错误'; @endphp

学生作答

{{ $this->questionData['mistake_info']['student_answer'] ?? '未作答' }}

@if (isset($this->questionData['mistake_info']['score']))
得分: {{ $this->questionData['mistake_info']['score'] }}/{{ $this->questionData['mistake_info']['full_score'] ?? '-' }}
@endif
{{ $statusLabel }}

正确答案

{!! \App\Services\MathFormulaProcessor::processFormulas($this->questionData['answer'] ?? '暂无') !!}

@else {{-- 正确答案 --}} @if (!empty($this->questionData['answer']))

正确答案

{!! \App\Services\MathFormulaProcessor::processFormulas($this->questionData['answer']) !!}

@endif @endif {{-- 解题思路 --}} @if (!empty($this->questionData['solution']))

解题思路

@php $solutionRaw = $this->questionData['solution']; $solutionProcessed = \App\Services\MathFormulaProcessor::processFormulas($solutionRaw); $solutionProcessed = preg_replace('/【(解题思路|详细解答|最终答案)】/u', '
【$1】
', $solutionProcessed); $solutionProcessed = preg_replace('/(第\s*\d+\s*步:)/u', '
$1', $solutionProcessed); $solutionProcessed = nl2br($solutionProcessed); @endphp
{!! $solutionProcessed !!}
@endif
{{-- AI分析(如果是错题) --}} @if ($this->sourceType === 'mistake' && !empty($this->questionData['mistake_info']['ai_analysis']))

AI 智能分析

@if (!empty($this->questionData['mistake_info']['ai_analysis']['reason']))

错误原因

{{ $this->questionData['mistake_info']['ai_analysis']['reason'] }}

@endif @if (!empty($this->questionData['mistake_info']['ai_analysis']['solution']))

改进方法

{{ $this->questionData['mistake_info']['ai_analysis']['solution'] }}

@endif @if (!empty($this->questionData['mistake_info']['ai_analysis']['suggestions']))

学习建议

{{ $this->questionData['mistake_info']['ai_analysis']['suggestions'] }}

@endif @if (!empty($this->questionData['mistake_info']['ai_analysis']['next_steps']))

后续步骤

    @php $nextSteps = $this->questionData['mistake_info']['ai_analysis']['next_steps']; if (!is_array($nextSteps)) { $nextSteps = []; } @endphp @foreach($nextSteps as $item)
  • {{ $item }}
  • @endforeach
@endif @php $modelUsed = $this->questionData['mistake_info']['ai_analysis']['model_used'] ?? ''; @endphp @if ($modelUsed)

分析模型: {{ $modelUsed }}

@endif
@endif {{-- 相关题目 --}} @if (!empty($this->relatedQuestions))

相似题目

@foreach($this->relatedQuestions as $relatedQuestion)
{{ substr($relatedQuestion['stem'] ?? '', 0, 100) }}... 查看详情
@if (!empty($relatedQuestion['difficulty'])) {{ $relatedQuestion['difficulty'] < 0.4 ? '简单' : ($relatedQuestion['difficulty'] < 0.7 ? '中等' : '困难') }} @endif
@endforeach
@endif
{{-- 右侧:信息面板 --}}
{{-- 题目信息 --}} @if ($this->questionData)

题目信息

题目ID
{{ $this->questionData['id'] ?? $this->questionData['question_code'] }}
@if (!empty($this->questionData['kp_code']))
知识点
{{ $this->getKnowledgePointName() }}
@endif
难度等级
{{ $this->getDifficultyLabel() }}
@php $globalAccuracy = $this->questionData['global_accuracy'] ?? $this->questionData['correct_rate'] ?? null; @endphp @if ($globalAccuracy !== null)
全体正确率
{{ round((float) $globalAccuracy * 100, 1) }}%
@endif @if (!empty($this->historySummary)) @php $accuracy = $this->historySummary['total'] > 0 ? ($this->historySummary['correct'] / $this->historySummary['total']) : null; if ($accuracy === null) { $masteryLabel = '未知'; $masteryStyle = 'bg-gray-100 text-gray-700'; } elseif ($accuracy >= 0.8) { $masteryLabel = '已掌握'; $masteryStyle = 'bg-green-100 text-green-700'; } elseif ($accuracy >= 0.5) { $masteryLabel = '待巩固'; $masteryStyle = 'bg-amber-100 text-amber-700'; } else { $masteryLabel = '待攻克'; $masteryStyle = 'bg-red-100 text-red-700'; } @endphp
掌握度
{{ $masteryLabel }}({{ $this->historySummary['correct'] }}/{{ $this->historySummary['total'] }})
@endif @if (!empty($this->questionData['created_at']))
创建时间
{{ \Carbon\Carbon::parse($this->questionData['created_at'])->format('Y-m-d H:i:s') }}
@endif
@endif {{-- 作答历史 --}} @if (!empty($this->historySummary))

作答历史

总尝试
{{ $this->historySummary['total'] }}
答对次数
{{ $this->historySummary['correct'] }}
最近结果
@if($this->historySummary['last_correct']) 正确 @else 错误 @endif
@if(!empty($this->historySummary['last_time']))
最近时间
{{ \Carbon\Carbon::parse($this->historySummary['last_time'])->format('Y-m-d H:i') }}
@endif
@endif {{-- 答题信息(错题/正确均展示) --}} @if ($this->sourceType === 'mistake' && !empty($this->questionData['mistake_info']))

{{ $this->questionData['mistake_info']['correct'] ? '答题信息' : '错题信息' }}

记录ID
{{ $this->mistakeId }}
学生
@if($this->studentName) {{ $this->studentName }}({{ $this->studentId }}) @else {{ $this->studentId }} @endif
是否正确
{{ $this->questionData['mistake_info']['correct'] ? '正确' : '错误' }}
错误类型
{{ $this->questionData['mistake_info']['error_type'] ?? '未分类' }}
错误类别
{{ $this->questionData['mistake_info']['mistake_category'] ?? '未分类' }}
@if (!empty($this->questionData['mistake_info']['created_at']))
记录时间
{{ \Carbon\Carbon::parse($this->questionData['mistake_info']['created_at'])->format('Y-m-d H:i:s') }}
@endif
@endif
@endif