@extends('layouts.exam') @php use App\Support\ExamText; $total = count($paper); $saved = $attempt->answers ?? []; $flags = array_map('intval', $attempt->flagged ?? []); $level = $exam->proctor_level ?: 'none'; $strict = $level === 'strict'; $answeredCount = collect($paper)->filter(fn ($q) => ! empty($saved[$q['id']] ?? []))->count(); $rules = collect(preg_split('/\R/', (string) $exam->instructions))->map(fn ($l) => trim(ltrim(trim($l), "•-* \t")))->filter()->values(); $candidate = $attempt->user?->name ?? auth()->user()->name; $fmtSeconds = fn ($s) => sprintf($s >= 3600 ? '%d:%02d:%02d' : '%2$d:%3$02d', intdiv($s, 3600), intdiv($s % 3600, 60), $s % 60); @endphp @section('content')
{{ $exam->title }}Candidate: {{ $candidate }} · {{ $attempt->code }}
All answers saved
{{ $fmtSeconds($secondsLeft) }}
@if($level !== 'none')
@if($strict)Strict proctoring. The exam runs in full screen. Switching tabs, leaving full screen, copying or pasting are integrity violations; the attempt is submitted automatically after {{ $exam->max_violations }}. @elseProctored exam. Switching tabs or windows, copying and pasting are recorded and shown on your score report.@endif
@endif
@foreach($paper as $i => $q) @php $sel = $saved[$q['id']] ?? []; $isFlag = in_array($q['id'], $flags, true); $count = count($q['options']); @endphp
0) hidden @endif>
Question {{ $q['no'] }} of {{ $total }} @if($q['domain']){{ $q['domain'] }}@endif
{{ ExamText::html($q['question']) }}

@if($q['multiple'])Select {{ $q['select'] }} answers.@elseif($q['type'] === 'truefalse')Select true or false.@else Select one answer.@endif

@foreach($q['options'] as $j => $o) @endforeach
@endforeach

Shortcuts: ← → previous / next · 1–9 or A–D choose an answer · F flag · Delete clear.

{{-- review before submit --}} @if($rules->isNotEmpty()) @endif {{-- full-screen gate (strict) / time-up: not dismissible, so not .modal --}}

Time is up

Your answers are being submitted and graded. Please do not close this window.

Submitting…

@endsection @push('scripts') @endpush