@extends('layouts.admin') @section('title', '題目詳情 #' . $question->id) @section('content')
← 返回列表 編輯此題
{{ match($question->question_type) { 'multiple_choice' => '選擇題', 'true_false' => '是非題', 'fill_blank' => '填充題', 'essay' => '問答題', default => '簡答題' } }} {{ $question->difficulty_label }} {{ $question->points ?? 1 }} 分 @if($question->is_public) 公用題庫 @else 私有 @endif @if(auth()->user()->isAdmin() || $question->isOwnedBy(auth()->user()))
@csrf
@endif @if($question->subject) | 科目:{{ $question->subject->name }} @endif @if($question->exam_id) | 考試:{{ $question->exam->title ?? '-' }} @endif @if($question->creator) | 提供者:{{ $question->creator->name }} @endif

{!! nl2br(e($question->question_text)) !!}

@if($question->image_path)
題目圖片

{{ $question->image_path }}

@endif @if($question->options)
@foreach($question->options as $key => $opt)
{{ $key }} {{ $opt }} @if($question->correct_answer === $key) @endif
@endforeach
@endif @if($question->correct_answer && !$question->options)
正確答案: {{ $question->correct_answer }}
@endif

AI 詳解

@csrf
@if($question->ai_explanation)
@if($question->ai_generated_answer)

AI 建議答案:{{ $question->ai_generated_answer }}

@endif @else

尚無 AI 詳解,點擊上方按鈕產生。

建立題目時會自動產生(需設定 AI_API_KEY)

@endif
@if($question->studentAnswers->count() > 0) @php $total = $question->studentAnswers->count(); $correct = $question->studentAnswers->where('is_correct', true)->count(); $rate = $total > 0 ? round($correct / $total * 100) : 0; @endphp

作答統計

{{ $total }}

作答人次

{{ $correct }}

答對人次

{{ $rate }}%

正確率

@endif
@endsection