@php use App\Enums\QuestionType; use App\Enums\TestType; @endphp {{-- ─────────────── LEFT: Question Area ─────────────── --}}
{{-- Card header: exam info + progress --}}
{{ $exam->test_type === TestType::PRE_TEST->value ? 'Pre-Test' : 'Post-Test' }}
{{ $exam->bank_question_title }}

{{ $exam->title ?? 'Training Assessment' }}

Soal 1 dari {{ $totalQ }}
@csrf @foreach($questions as $index => $q)
{{-- Question number label --}}
No. {{ $index + 1 }} @if($q->question_type === QuestionType::MC->value) Pilihan Ganda @else Essay @endif
{{-- Question content --}}
@if($q->question_image) Gambar Soal @endif @if($q->question_text && trim($q->question_text) !== '')

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

@endif
{{-- Answer area --}} @if($q->question_type === QuestionType::MC->value)
@forelse($q->options as $opt) @php $optLabel = chr(65 + $loop->index); $isSelected = $q->saved_answer && $q->saved_answer->id_trn_mc_option == $opt->id; @endphp @empty

Pilihan ganda tidak tersedia.

@endforelse
@else @php $savedImg = $q->saved_answer->essay_image ?? null; @endphp
@if($savedImg)
Gambar Jawaban
@endif

Jawaban disimpan otomatis.

@endif {{-- Bottom navigation --}}
@if($index > 0) @else
@endif @if($index < $totalQ - 1) @else @endif
@endforeach