{{-- Header Actions --}}
← Back to Exams
Edit Settings
@if(session('success'))
{{ session('success') }}
@endif {{-- Meta Data Card --}}

{{ $exam->title }}

{{ str_replace('_', ' ', $exam->type) }} • {{ $exam->subject->name ?? 'Unknown Subject' }}

{{ $exam->total_points ?? 0 }}

Points Built

{{ (float)$exam->max_score }}

Target Max

Class & Teacher

{{ $exam->schoolClass->name ?? 'N/A' }}

{{ $exam->teacher->name ?? 'N/A' }}

Schedule

{{ $exam->scheduled_at ? $exam->scheduled_at->format('M d, Y') : 'Unscheduled' }}

{{ $exam->scheduled_at ? $exam->scheduled_at->format('h:i A') : '' }} ({{ $exam->duration_minutes }} min)

Scoring Target

{{ (float)$exam->max_score }} Points Max

{{ (float)$exam->passing_score }} to pass

Status

@if($exam->status === 'published') Published @elseif($exam->status === 'draft') Draft @else {{ str_replace('_', ' ', $exam->status) }} @endif
{{-- Tabs --}}
{{-- TAB 1: QUESTIONS DISPLAY & INLINE EDITOR --}}
@forelse($exam->questions as $index => $question)
{{-- ========================================== --}} {{-- VIEW MODE --}} {{-- ========================================== --}}
{{ $index + 1 }} {{ str_replace('_', ' ', $question->question_type) }} {{ (float)$question->points }} Points
@csrf @method('DELETE')

{!! nl2br(e($question->question_text)) !!}

@if($question->isMultipleChoice() || $question->isTrueFalse())
@foreach($question->options as $option)
@if($option->is_correct)
@endif
{{ $option->option_text }}
@endforeach
@elseif($question->isNumeric())

Acceptable Answer:

{{ (float)$question->correct_numeric_answer }} (Tolerance: ±{{ (float)$question->numeric_tolerance }})

@elseif($question->isShortAnswer())

Exact Match Required ({{ $question->case_sensitive ? 'Case Sensitive' : 'Case Insensitive' }}):

"{{ $question->correct_text_answer }}"

@elseif($question->isLongEssay())

✍️ Long Essay (Manual Grading Required)

@if($question->explanation)

Grading Rubric: {{ $question->explanation }}

@endif
@endif @if($question->explanation && !$question->isLongEssay())

Teacher Explanation

{{ $question->explanation }}

@endif
{{-- ========================================== --}} {{-- EDIT MODE (Inline Form) --}} {{-- ========================================== --}}
@csrf @method('PUT')

Editing Question #{{ $index + 1 }}

@php $mcOptions = $question->question_type === 'multiple_choice' ? $question->options : collect(); @endphp @for($i = 0; $i < 4; $i++) @php $opt = $mcOptions->get($i); @endphp
is_correct) || ($i==0 && !$opt) ? 'checked' : '' }} class="w-4 h-4 text-emerald-600">
@endfor
@php $tfCorrect = $question->correctOption()?->option_text === 'True'; @endphp

Long Essay questions are manually graded by the teacher. Provide an optional grading rubric or expected points below.

@empty

No questions added yet. Click "Build Questions" to start or Import from a Bank.

@endforelse
{{-- TAB 2: RESULTS (Placeholder for Exam Results Table) --}} {{-- ========================================== --}} {{-- BUILDER ENGINE MODAL --}} {{-- ========================================== --}} {{-- ========================================== --}} {{-- IMPORT FROM BANK MODAL --}} {{-- ========================================== --}}