@extends('layouts.app') @section('content')

Pratinjau Soal

Q.ID #{{ $question->id }} (Old: {{ $question->old_id ?? '-' }})
Materi {{ $question->subject->name ?? 'Umum' }}
Tipe Soal {{ str_replace('_', ' ', $question->question_type) }}
Level {{ strtoupper($question->question_level) }}
Departemen: {{ $question->department->name ?? 'Global' }}
Posisi: {{ $question->position->name ?? 'Global' }}
Kriteria: PG: {{ $question->passing_grade }} | Durasi: {{ $question->duration }} dtk
{!! nl2br(e($question->question_text)) !!}

Struktur Kunci & Pilihan

@php $ans = $question->correct_answer; $arrKeys = is_string($ans) ? json_decode($ans, true) : (is_array($ans) ? $ans : [$ans]); if(!is_array($arrKeys)) $arrKeys = []; @endphp @if($question->question_type === 'descriptive')
{!! nl2br(e($question->option_a)) !!}
@elseif($question->question_type === 'true_false')
True (Benar)
False (Salah)
@else @foreach(['A' => 'option_a', 'B' => 'option_b', 'C' => 'option_c', 'D' => 'option_d', 'E' => 'option_e'] as $k => $col) @if(!empty($question->$col))
{{ $k }} {{ $question->$col }}
@if(in_array($k, $arrKeys) || in_array($col, $arrKeys)) Kunci @endif
@endif @endforeach @endif
Dibuat oleh: {{ $question->creator->first_name ?? 'ID '.$question->created_by }} pada {{ $question->created_at->format('d M Y') }}
@endsection