@extends('layouts.app') @section('title', '考試成績') @section('content')

{{ $exam->title }}

{{ $result->score }}

@if($result->score >= 90) 太棒了! @elseif($result->score >= 80) 表現優異! @elseif($result->score >= 60) 及格了! @elseif($result->score >= 40) 再加油! @else 需要多練習! @endif

完成時間:{{ $result->completed_at->format('Y-m-d H:i') }}

@php $correct = $answers->where('is_correct', true)->count(); $total = $exam->questions->count(); $wrong = $total - $correct; @endphp

{{ $correct }}

答對

{{ $wrong }}

答錯

{{ $total }}

總題數

@if($history->count() > 1)

歷史成績

@foreach($history as $h)

{{ $h->score }}

{{ $h->completed_at->format('m/d') }}

@endforeach
@endif

答題詳情

@foreach($exam->questions as $index => $question) @php $answer = $answers[$question->id] ?? null; @endphp
@if($answer && $answer->is_correct) @else @endif

第 {{ $index + 1 }} 題: {{ $question->question_text }}

@if($question->image_path)
題目圖片
@endif @if($question->question_type === 'multiple_choice' && $question->options)
@foreach($question->options as $key => $optionText) @php $isCorrectOption = mb_strtoupper(trim($question->correct_answer ?? '')) === $key; $isStudentChoice = $answer && mb_strtoupper(trim($answer->student_answer)) === $key; @endphp
{{ $key }} {{ $optionText }} @if($isCorrectOption) @endif
@endforeach
@endif

您的答案: {{ $answer->student_answer ?? '未作答' }}

@if($question->correct_answer)

正確答案: {{ $question->correct_answer }}

@endif
@if($question->ai_explanation)
AI 詳解
@else @endif
AI 詳解
@endforeach
返回列表 再次練習
@endsection