@extends('layouts.app') @section('title', 'Assessment Result') @section('content') @php $passed = $attempt->passed; $canRetake = ! $passed && (! $module->max_attempts || $attempt->attempt_number < $module->max_attempts); $celebrate = $passed && session('certificate_earned'); @endphp {{-- Congratulations pop-up — shown once, right after the course is completed --}} @if($celebrate) @endif {{-- Result banner --}}
{{ $attempt->score_percent }}%
{{ $passed ? 'verified' : 'cancel' }} {{ $passed ? 'Passed' : 'Not passed' }}

{{ $module->title }}

{{ $course->title }} · Pass mark {{ $module->pass_mark }}% · Attempt {{ $attempt->attempt_number }}

Back to course @if($canRetake) Retake @endif
{{-- Action items — focused remediation when the learner didn't pass --}} @unless($passed)
assignment_late

What to do next

You scored {{ $attempt->score_percent }}% — the pass mark is {{ $module->pass_mark }}%. Focus your revision on the points below, then @if($canRetake) retake the assessment. @else ask your manager about another attempt. @endif

{{-- The exact questions this attempt got wrong --}} @if($missed->isNotEmpty())

Questions to revise ({{ $missed->count() }})

@endif {{-- Content modules to re-read before retaking --}} @if($reviewModules->isNotEmpty())

Re-read these modules

@foreach($reviewModules as $m) menu_book Module {{ $m->module_number }}: {{ \Illuminate\Support\Str::limit($m->title, 40) }} @endforeach
@endif
@if($canRetake) refresh Retake assessment @endif arrow_back Back to course
@endunless {{-- Attempt history — every recorded attempt (passes and failures) --}} @if($history->count() > 1)
history

Your attempts

({{ $history->count() }}{{ $module->max_attempts ? ' of '.$module->max_attempts : '' }})
@foreach($history as $h)
Attempt {{ $h->attempt_number }} {{ $h->score_percent }}% {{ $h->passed ? 'check_circle' : 'cancel' }}{{ $h->passed ? 'Passed' : 'Failed' }} {{ optional($h->completed_at)->format('j M Y, H:i') }}
@endforeach
@endif {{-- Per-question review --}}

Review

@foreach($attempt->answers ?? [] as $i => $log) @php $q = $questions->get($log['question_id']); @endphp @continue(! $q) @php $selected = collect($log['selected'] ?? []); $wasCorrect = $log['correct'] ?? false; @endphp
{{ $wasCorrect ? 'check_circle' : 'cancel' }}

{{ $loop->iteration }}. {{ $q->text }}

@if($q->explanation)

Why: {{ $q->explanation }}

@endif
@endforeach
@endsection