@if($pq && $pq->questionnaireSet)
{{ $pq->questionnaireSet->title }}
{{ $pq->questionnaireSet->questions->count() }} soalan
@if($pq->questionnaireSet->description)
{{ $pq->questionnaireSet->description }}
@endif
@if($pq->is_confirmed)
Disahkan
@else
Belum Disahkan
@endif
@if($pq->is_confirmed)
Disahkan oleh {{ $pq->confirmedBy?->name ?? '—' }}
pada {{ $pq->confirmed_at?->format('d M Y, H:i') }}.
@else
Soalselidik perlu disahkan sebelum peserta boleh menjawab.
@endif
{{-- List Questions --}}
Senarai Soalan:
@php
$allQs = $pq->questionnaireSet->questions->sortBy('sort_order');
$topQs = $allQs->whereNull('parent_id');
$qNum = 0;
@endphp
@foreach($topQs as $q)
@if($q->question_type === 'tajuk')
Tajuk
{{ $q->question_text }}
@foreach($allQs->where('parent_id', $q->id)->sortBy('sort_order') as $child)
@php $qNum++ @endphp
{{ $qNum }}
{{ $child->question_text }}
Rating 1–5
@if($child->is_required)
Wajib@endif
@endforeach
@else
@php $qNum++ @endphp
{{ $qNum }}
{{ $q->question_text }}
{{ match($q->question_type) {
'rating' => 'Rating 1–5',
'single_choice' => 'Pilihan Tunggal',
'multiple_choice' => 'Pilihan Berganda',
'short_text' => 'Teks Pendek',
'long_text' => 'Teks Panjang',
default => $q->question_type,
} }}
@if($q->is_required)
Wajib@endif
@endif
@endforeach
{{-- Detach --}}
@else
Belum ada soalselidik dilampirkan untuk program ini.
@endif