@extends('layouts.teacher') @section('title', 'Kelola Soal') @section('header_title', 'Penyusunan Soal') @section('content') @if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif

Input Soal Baru

{{-- ========================================================= FORM ADD (POST) — tetap seperti semula ========================================================= --}}
@csrf

Klik untuk upload atau drag & drop

Format: JPG, PNG, WebP | Maks: 500KB

A
Benar
B
Benar

2 opsi tersedia

{{-- ========================================================= FORM EDIT (POST ke route update_question, _method PATCH) — FORM TERPISAH supaya tidak konflik dengan form tambah ========================================================= --}}

{{ $exam->title }}

{{ $exam->duration }} Menit {{ $questions->count() }} Soal
{{ $questions->count() }} Soal
@forelse($questions as $index => $q)
No. {{ $index + 1 }}
@csrf @method('DELETE')
@if($q->question_image)
Gambar Soal
Gambar Soal {{ $index + 1 }}
@endif

{{ $q->question }}

@php $options = ['a'=>$q->option_a,'b'=>$q->option_b,'c'=>$q->option_c,'d'=>$q->option_d]; $filledOptions = array_filter($options, fn($v) => !empty(trim($v ?? ''))); @endphp @foreach($filledOptions as $opt => $value) @php $isCorrect = strtolower($q->correct_option) == $opt; @endphp
{{ strtoupper($opt) }}
{{ $value }}
@if($isCorrect)
Benar
@endif
@endforeach
{{ count($filledOptions) }} opsi jawaban
@empty

Belum ada soal

Silakan input pertanyaan secara manual atau gunakan fitur Import Excel.

@endforelse
@endsection