@extends('layouts.app') @section('title', 'Detail Panel Test') @section('content')

{{ $panelTest->title }}

{{ $panelTest->product->name }} • {{ $panelTest->test_date->format('d M Y') }}
Edit @if($panelTest->status === 'draft')
@csrf
@elseif($panelTest->status === 'active')
@csrf
@endif
{{-- Kolom Kiri --}}
{{-- Info Panel Test --}}
Informasi Test
{{ ucfirst($panelTest->status) }}
@if($panelTest->test_number) @endif
No. Test {{ $panelTest->test_number }}
Produk{{ $panelTest->product->name }}
Tanggal{{ $panelTest->test_date->format('d M Y') }}
Lokasi{{ $panelTest->location ?: '-' }}
Tipe @if($panelTest->type === 'internal') Internal @elseif($panelTest->type === 'public') Publik @else Regional @endif
Sampel {{ $panelTest->samples->count() }} sampel
Pertanyaan {{ $panelTest->questions->count() }} total
Peserta {{ $panelTest->testSessions->where('status','completed')->count() }} orang
@if($panelTest->description)

{{ $panelTest->description }}

@endif
{{-- QR Code & Link --}} @if(in_array($panelTest->type, ['internal','public']))
QR Code & Link {{ $panelTest->type === 'internal' ? 'Internal' : 'Publik' }}
@if($panelTest->access_token)
Berlaku: {{ $panelTest->token_expires_at?->format('d M Y') ?? 'Tidak terbatas' }}

Scan untuk Mengikuti Test

Arahkan kamera HP ke QR Code di atas

@else

Generate link untuk membuat QR Code

@endif @if($panelTest->status === 'active')
@csrf
@endif
@endif {{-- Daftar Peserta --}}
Peserta yang Sudah Mengisi
@forelse($panelTest->testSessions->where('status','completed') as $session)
{{ strtoupper(substr($session->user->name, 0, 1)) }}
{{ $session->user->name }}
{{ $session->completed_at->format('d M, H:i') }}
@empty
Belum ada peserta
@endforelse
{{-- Kolom Kanan --}}
@php $sampleColors = ['3b82f6','22c55e','f59e0b','ef4444','8b5cf6']; @endphp {{-- Daftar Sampel --}} @foreach($panelTest->samples as $si => $sample) @php $color = $sampleColors[$si % 5]; @endphp
Sampel {{ $si + 1 }} {{ $sample->name }} @if($sample->code){{ $sample->code }}@endif
@if($sample->description){{ $sample->description }}@endif
{{ $sample->questions->count() }} pertanyaan @if($panelTest->status === 'draft')
@csrf @method('DELETE')
@endif
@if($panelTest->status === 'draft' && $panelTest->samples->count() > 1)
Salin pertanyaan dari sampel lain ke {{ $sample->name }}:
@csrf
@endif @forelse($sample->questions as $qi => $q)
{{ $qi + 1 }}
{{ $q->question_text }}
{{ $q->question_type }} @if($q->options) @foreach($q->options as $opt) {{ $opt }} @endforeach @endif
@if($panelTest->status === 'draft')
@csrf @method('DELETE')
@endif
@empty
Belum ada pertanyaan. Salin dari sampel lain atau tambah manual.
@endforelse @if($panelTest->status === 'draft')
Tambah pertanyaan ke {{ $sample->name }}:
@csrf
@endif
@endforeach {{-- Tambah Sampel Baru (hanya divisi) --}} @if($panelTest->unit_type !== 'marketing' && $panelTest->status === 'draft')
Tambah Sampel Baru (Gelas A, Gelas B, dst)
@csrf
@if($panelTest->samples->count() > 0)
@endif
@if($panelTest->samples->count() > 0)
Tips: Pilih "Salin dari" untuk menyalin pertanyaan otomatis!
@endif
@endif {{-- Pertanyaan Kesimpulan (hanya divisi) --}} @if($panelTest->unit_type !== 'marketing')
Pertanyaan Kesimpulan Ditampilkan setelah semua sampel dinilai
{{ $panelTest->generalQuestions->count() }} pertanyaan
@forelse($panelTest->generalQuestions as $i => $q)
{{ $i + 1 }}
{{ $q->question_text }}
{{ $q->question_type }} @if($q->options) @foreach($q->options as $opt) {{ $opt }} @endforeach @endif
@if($panelTest->status === 'draft')
@csrf @method('DELETE')
@endif
@empty

Belum ada pertanyaan kesimpulan

@endforelse @if($panelTest->status === 'draft')
@csrf
@endif
@endif
@endsection @push('scripts') @endpush