@extends('layouts.app') @section('title', 'Exam attempt #' . $attempt->id) @section('breadcrumb') Dashboard Exam attempts #{{ $attempt->id }} @endsection @push('styles') @endpush @section('content')
{{-- Candidate info --}}

Candidate

Name
{{ $attempt->user?->name }}
Email
{{ $attempt->user?->email }}
CNIC
{{ $attempt->user?->candidateProfile?->cnic ?? '—' }}
Roll number
@if($attempt->application?->roll_number) {{ $attempt->application->roll_number }} @else @endif
Post
{{ $attempt->post?->code }}
{{ $attempt->post?->title }}
{{-- Attempt info --}}

Attempt details

@php $statusTone = match (true) { str_contains($attempt->status, 'complet') => 's-success', str_contains($attempt->status, 'progress') => 's-info', str_contains($attempt->status, 'review') => 's-warning', default => 's-neutral', }; @endphp {{ $attempt->status_label }}
Attempt
#{{ $attempt->attempt_no }}
Score
@if($attempt->score !== null) {{ $attempt->score }} /{{ $attempt->total_questions }} ({{ $attempt->percentage_score }}%) @else @endif
Force submitted
@if($attempt->force_submitted) Yes — auto-submitted @else No @endif
Started at
{{ $attempt->started_at?->format('d M Y, h:i A') ?? '—' }}
Submitted at
{{ $attempt->submitted_at?->format('d M Y, h:i A') ?? '—' }}
Last activity
{{ $attempt->last_activity_at?->format('d M Y, h:i A') ?? '—' }}
IP address
{{ $attempt->ip_address ?? '—' }}
{{-- Anti-cheat summary --}}

Anti-cheating summary

@if($attempt->force_submitted) Force-submitted @endif
{{ $attempt->warning_count }}
Total warnings
{{ $attempt->tab_switch_count }}
Tab switches
{{ $attempt->fullscreen_exit_count }}
Fullscreen exits
{{-- Score breakdown (only for completed attempts) --}} @if($attempt->isCompleted())

Score breakdown

{{ $attempt->total_correct }}
Correct
{{ $attempt->total_wrong }}
Wrong
{{ $attempt->total_unanswered }}
Unanswered
{{ $attempt->percentage_score }}%
Percentage
@endif {{-- Answer sheet --}} @if($attempt->answers->isNotEmpty())

Answer sheet

{{ $attempt->answers->count() }} questions
@foreach($attempt->answers as $answer) @endforeach
# Question Selected Correct Result
{{ $loop->iteration }}
{{ Str::limit($answer->question?->question_text, 90) }}
@if($answer->selected_answer) {{ strtoupper($answer->selected_answer) }}
{{ Str::limit($answer->question?->{'option_' . $answer->selected_answer}, 32) }}
@else @endif
{{ strtoupper($answer->question?->correct_answer) }}
{{ Str::limit($answer->question?->correct_answer_text, 32) }}
@if($answer->selected_answer === null) Unanswered @elseif($answer->is_correct) Correct @else Wrong @endif
@endif {{-- Security event history --}} @if($attempt->securityLogs->isNotEmpty())

Security event history

{{ $attempt->securityLogs->count() }} events
@foreach($attempt->securityLogs->sortByDesc('created_at') as $secLog) @endforeach
# Event type Message Warning # IP address Time
{{ $loop->iteration }} {{ $secLog->event_type_label }} {{ $secLog->event_message ?? '—' }} @if($secLog->event_count_snapshot !== null) {{ $secLog->event_count_snapshot }} @else @endif {{ $secLog->ip_address ?? '—' }} {{ $secLog->created_at->format('d M Y, h:i A') }}
@endif {{-- Reset history --}} @if($attempt->resetLogs->isNotEmpty())

Reset history

{{ $attempt->resetLogs->count() }}
@foreach($attempt->resetLogs as $log) @endforeach
# Reset by (admin) Previous status Reset type Reason Date
{{ $loop->iteration }}
{{ $log->admin?->name }}
{{ $log->admin?->email }}
{{ ucfirst(str_replace('_', ' ', $log->previous_status)) }} {{ ucfirst(str_replace('_', ' ', $log->reset_type)) }} {{ $log->reset_reason }} {{ $log->created_at->format('d M Y, h:i A') }}
@endif {{-- Result email status --}} @if($emailLog)

Result email

Status
@if($emailLog->isSent()) Sent @elseif($emailLog->isFailed()) Failed @else Pending @endif
Recipient
{{ $emailLog->email_to }}
Subject
{{ $emailLog->email_subject }}
@if($emailLog->isSent())
Sent at
{{ $emailLog->sent_at?->format('d M Y, h:i A') }}
@endif @if($emailLog->isFailed())
Failure reason
{{ $emailLog->failure_reason }}
@endif
@endif {{-- ── Reset modal ─────────────────────────────────────────────────── --}} @if(in_array($attempt->status, ['in_progress', 'in_review', 'completed'])) @endif @endsection @push('scripts') @endpush