@extends('layouts.admin') @section('title', $exam->name) @section('content') @can('update', $exam) Edit @endcan @can('manageQuestions', $exam) Question Builder @endcan @can('preview', $exam) Preview @endcan @can('assign', $exam) @endcan @can('duplicate', $exam)
@csrf
@endcan @can('publish', $exam)
@csrf
@endcan @can('unpublish', $exam)
@csrf
@endcan @can('archive', $exam)
@csrf
@endcan @can('delete', $exam) @endcan
@if ($exam->isDraft() && $issues !== [])
Cannot publish exam:
@elseif ($exam->isDraft())
This draft passes every publish check and can be published.
@elseif ($exam->isPublished())
Published {{ $exam->published_at?->format('d M Y H:i') }}. Questions are locked; unpublish to change them.
@else
Archived {{ $exam->archived_at?->format('d M Y H:i') }}. This exam is read-only.
@endif
{{ $exam->name }} {{ $exam->display_name }} {{ $exam->description }} @if ($exam->library) {{ $exam->library->name }} @else Any case @endif {{ $exam->duration_minutes }} minutes {{ rtrim(rtrim(number_format($exam->passing_percentage, 2), '0'), '.') }}% {{ $exam->randomize_questions ? 'Yes' : 'No' }} {{ $exam->allow_skip ? 'Yes' : 'No' }} {{ $exam->feedback_mode?->label() }} {{ $exam->max_attempts ?? 'Unlimited' }} {{ $exam->creator?->name ?? 'System' }} · {{ $exam->created_at?->format('d M Y H:i') }} {{ $exam->updater?->name ?? '—' }} · {{ $exam->updated_at?->format('d M Y H:i') }}
Questions {{ $exam->questions->count() }} Total points: {{ $exam->totalPoints() }}
@forelse ($exam->questions as $index => $question) @php $needsTarget = $question->question_type->requiresTarget(); $hasTarget = $needsTarget && $question->hasTargetAnnotation(); @endphp
{{ $index + 1 }}.
{{ $question->displayText() }}
Case @if ($question->xrayCase) {{ $question->xrayCase->name }} @else Missing @endif
View{{ $question->xrayView?->label() ?? '—' }}
Item{{ $question->itemOfInterest?->name ?? ($question->targetsAllItems() ? 'All items on view' : '—') }}
Type{{ $question->question_type->label() }} @if ($question->question_type === \App\Enums\QuestionType::OkNotOk) {{ $question->correct_answer?->label() ?? 'No expected answer' }} @endif
Points{{ $question->points }}
@if ($needsTarget) {{ $hasTarget ? 'Target set' : 'No target' }} @endif @unless ($question->is_required) Optional @endunless
@empty @can('manageQuestions', $exam) Open Question Builder @endcan @endforelse
Assigned students {{ $assignmentSummary['active'] }} active {{ $assignmentSummary['total'] }} total @if ($exam->isAssignable()) Cancelled assignments stay as history. @else Only published exams can be assigned to students. @endif
@include('admin.exam-assignments._table', ['assignments' => $exam->assignments, 'showStudent' => true, 'showExam' => false, 'emptyMessage' => $exam->isAssignable() ? 'Use "Assign Students" to hand this exam to trainees.' : 'Publish the exam to assign it.'])
@can('assign', $exam) @include('admin.exams._assign-modal') @endcan @endsection