@extends('layouts.student') @section('title','My Result') @section('content')
{{-- Header card --}}

{{ in_array($attempt->status, ['submitted','timed_out']) ? 'Exam Completed' : 'Result' }}

{{ $attempt->examSession->title }}

@if($attempt->status === 'timed_out') Time Expired @endif
{{-- Total score --}}
{{ $attempt->total_score }}
out of {{ $attempt->total_questions }} questions
@php $pct = $attempt->total_questions > 0 ? round(($attempt->total_score / $attempt->total_questions) * 100) : 0; @endphp
{{ $pct }}% Overall
@if($timeTaken)
Completed in {{ $timeTaken }} minutes
@endif
{{-- Per subject breakdown --}}
Subject Breakdown
@foreach($attempt->results as $result) @php $pctSubject = round($result->score); @endphp @endforeach
Subject Score Correct Wrong Unanswered Performance
{{ $result->subject->name }} {{ $pctSubject }}% {{ $result->correct_answers }} {{ $result->wrong_answers }} {{ $result->unanswered }}
{{-- Action buttons --}}
@endsection