@props(['course', 'module' => null, 'question' => null]) {{-- Add or edit one MCQ: the question, up to four answers, and which one is correct --}} @php $key = $question ? "q{$question->id}" : 'nq'.($module->id ?? 'final'); $options = array_pad($question?->options ?? [], 4, ''); @endphp
@csrf @if ($question) @method('PUT') @endif
Answers (select the correct one, leave unused rows blank)
@foreach ($options as $i => $option)
correct === $i) class="h-4 w-4 shrink-0 border-slate-300 text-brand focus:ring-brand">
@endforeach
{{ $slot }}