@extends('components.app-layout') @section('title', $exam->title . ' - Exam Details') @section('content')
Back
{{ $exam->type_label }}

{{ $exam->title }}

{{ $exam->course->title }}

@if($canTake)
@csrf @if($exam->access_mode === 'password_protected')
@endif
@else
@if($remainingAttempts <= 0) Max attempts reached @elseif($exam->isUpcoming()) Available {{ $exam->start_time->diffForHumans() }} @elseif($exam->isPast()) Exam has ended @else Not available @endif
@endif
@if($exam->instructions)

Instructions

{!! nl2br(e($exam->instructions)) !!}
@endif

Exam Details

@php $details = [ ['label' => 'Duration', 'value' => $exam->duration_minutes > 0 ? $exam->duration_minutes . ' minutes' : 'Unlimited'], ['label' => 'Questions', 'value' => $exam->question_count], ['label' => 'Total Marks', 'value' => $exam->total_marks], ['label' => 'Passing Score', 'value' => $exam->passing_percentage . '%'], ['label' => 'Max Attempts', 'value' => $exam->max_attempts > 0 ? $exam->max_attempts : 'Unlimited'], ['label' => 'Remaining', 'value' => $remainingAttempts === PHP_INT_MAX ? 'Unlimited' : $remainingAttempts], ['label' => 'Randomized', 'value' => $exam->randomize_questions ? 'Yes' : 'No'], ['label' => 'Review Allowed', 'value' => $exam->allow_review ? 'Yes' : 'No'], ]; @endphp @foreach($details as $detail)

{{ $detail['label'] }}

{{ $detail['value'] }}

@endforeach
@if($previousAttempts->count() > 0)

Your Previous Attempts

@foreach($previousAttempts as $attempt)

Attempt #{{ $attempt->attempt_number }}

{{ $attempt->ended_at?->format('M d, Y H:i') ?? 'In progress' }}

@if($attempt->result && $attempt->result_published) {{ $attempt->result->percentage }}% @else Pending @endif
@endforeach
@endif

Timing

@if($exam->is_always_open)
Always open
@else @if($exam->start_time)
Opens {{ $exam->start_time->format('M d, Y H:i') }}
@endif @if($exam->end_time)
Closes {{ $exam->end_time->format('M d, Y H:i') }}
@endif @endif

Security

@php $securityItems = [ ['label' => 'Proctoring', 'enabled' => $exam->enable_proctoring], ['label' => 'Fullscreen Required', 'enabled' => $exam->fullscreen_required], ['label' => 'Tab Switch Detection', 'enabled' => $exam->tab_switch_detection], ]; @endphp @foreach($securityItems as $item)
{{ $item['label'] }} {{ $item['enabled'] ? 'Enabled' : 'Disabled' }}
@endforeach
@endsection