@if (!session('test4_code_submitted'))
{{-- Rules Test 4 --}}
Mulai Tes
Setelah siap, klik tombol di bawah untuk memulai tes.
@if (empty($invitation_id))
Undangan tes tidak ditemukan. Silakan akses dari
halaman Aktivitas Lamaran.
@endif
@else
@php
$currentQ = $questions->first();
$detail = $currentQ?->detail;
$hasImage = $detail && $detail->image_url;
$hasOptions = $detail && $detail->options;
$optionsArr = $hasOptions
? (is_array($detail->options)
? $detail->options
: json_decode($detail->options, true))
: [];
// Question Type
// type A: Gambar + Pilihan Ganda
// type B: Text + Pilihan Ganda
// type C: Text + Input
$qType = 'C';
if ($hasOptions) {
$qType = 'B';
}
if ($hasImage && $hasOptions) {
$qType = 'A';
}
$existingAns = $currentQ
? \App\Models\ApplicantAnswer::where('test_session_id', $testSession->id)
->where('question_id', $currentQ->id)
->first()
: null;
$savedAnswer = $existingAns?->answer ?? '';
if ($hasImage) {
$imgSrc = str_starts_with($detail->image_url, 'http')
? $detail->image_url
: asset(\Illuminate\Support\Facades\Storage::url($detail->image_url));
}
@endphp
{{-- Header --}}
{{-- Progress Bar --}}
{{-- Nav Dots --}}
@for ($p = 1; $p <= $totalPages; $p++)
{{ $p }}
@endfor
{{-- Question --}}
{{-- Soal Gambar --}}
@if ($hasImage)
@endif
{{-- soal & jawaban --}}
Soal {{ $currentPage }}
{{ $detail?->question ?? '-' }}
@if ($hasOptions && count($optionsArr) > 0)
{{-- Pilihan Ganda --}}
@else
{{-- Input Teks --}}
@endif
{{-- Navigation forms --}}