@extends('layouts.app') @section('title', $exam->title . ' - 作答中') @section('content') @php $questions = $exam->questions; $total = $questions->count(); @endphp
@csrf {{-- 所有題目的 hidden inputs(含未作答的) --}} @foreach($questions as $i => $q) @endforeach
{{-- ====== 左側:題目區 ====== --}}
{{-- 頂部資訊列 --}}

{{ $exam->title }}

@if($exam->subject){{ $exam->subject->name }}@endif 共 {{ $total }} 題
{{-- 倒數計時 --}}
{{-- 題目卡片 --}} @foreach($questions as $i => $question)
{{-- 題號 + 標記 --}}
{{ $i + 1 }}
{{ match($question->question_type) { 'multiple_choice' => '選擇題', 'true_false' => '是非題', 'fill_blank' => '填充題', 'essay' => '問答題', default => '簡答題' } }} {{ $question->difficulty_label }}
{{ $question->points ?? 1 }} 分
{{-- 題目內容 --}}
{{ $question->question_text }}
{{-- 題目圖片 --}} @if($question->image_path)
題目圖片
@endif {{-- 選項 --}} @if($question->question_type === 'multiple_choice' && $question->options)
@foreach($question->options as $key => $optionText) @endforeach
@elseif($question->question_type === 'true_false')
@else @endif
@endforeach {{-- 上一題 / 下一題 --}}
/ {{ $total }} 題
{{-- ====== 右側:題號面板 ====== --}}
{{-- 手機版底部工具列 --}}
{{-- 手機版題號面板(彈出) --}}

答題狀態

@foreach($questions as $i => $q) @endforeach
已答 未答 標記
{{-- 交卷確認 --}}

確認交卷

已作答
未作答
已標記待檢查

還有 題尚未作答,確定要交卷嗎?

@endsection