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

Edit Panel Test

{{ $panelTest->title }}
@if(session('success'))
{!! session('success') !!}
@endif @if($errors->any())
@endif
{{-- Kolom Kiri: Form Info Panel Test --}}
Informasi Panel Test
@csrf @method('PUT') {{-- Produk --}}
@error('product_id')
{{ $message }}
@enderror
{{-- Judul --}}
@error('title')
{{ $message }}
@enderror
{{-- Deskripsi --}}
@error('description')
{{ $message }}
@enderror
{{-- Tanggal --}}
@error('test_date')
{{ $message }}
@enderror
{{-- Lokasi --}}
@error('location')
{{ $message }}
@enderror
{{-- Status --}}
@error('status')
{{ $message }}
@enderror
{{-- Info Unit readonly --}}

Info Unit (tidak dapat diubah)

{{-- Tombol Simpan --}}
Batal
{{-- Kolom Kanan: Sampel & Pertanyaan --}}
@php $sampleColors = ['3b82f6','22c55e','f59e0b','ef4444','8b5cf6']; @endphp {{-- Pertanyaan Umum --}}
Pertanyaan Umum Berlaku untuk semua sampel
{{ $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
{{-- ✅ Tombol hapus pertanyaan selalu tampil --}}
@csrf @method('DELETE')
@empty

Belum ada pertanyaan umum

@endforelse {{-- ✅ Form tambah pertanyaan umum selalu tampil --}}
@csrf
{{-- Daftar Sampel --}} @foreach($panelTest->samples as $si => $sample) @php $color = $sampleColors[$si % 5]; @endphp
Sampel {{ $si + 1 }} {{-- ✅ Nama sampel bisa diedit inline --}}
@csrf @method('PUT')
{{ $sample->questions->count() }} pertanyaan {{-- ✅ Tombol hapus sampel selalu tampil --}}
@csrf @method('DELETE')
{{-- Salin pertanyaan dari sampel lain --}} @if($panelTest->samples->count() > 1)
Salin pertanyaan dari sampel lain ke {{ $sample->name }}:
@csrf
@endif {{-- Daftar pertanyaan --}} @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
{{-- ✅ Tombol hapus pertanyaan selalu tampil --}}
@csrf @method('DELETE')
@empty
Belum ada pertanyaan.
@endforelse {{-- ✅ Form tambah pertanyaan selalu tampil --}}
Tambah pertanyaan ke {{ $sample->name }}:
@csrf
@endforeach {{-- ✅ Form tambah sampel baru selalu tampil --}}
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
@endsection @push('scripts') @endpush