@extends('layouts.app') @section('title', 'Exam Result') @section('page-title', 'Your Result') @section('content') @php $passed = $attempt->passed; $pct = round($attempt->percentage, 1); $grade = $attempt->grade_label; $exam = $attempt->exam; @endphp
{{ $passed ? '🎉' : '📚' }}
{{ $pct }}%
{{ $passed ? 'Congratulations! You Passed' : 'Better Luck Next Time' }}
{{ $exam->title }}
Grade: {{ $grade }} {{ $attempt->total_score }}/{{ $exam->total_marks }} marks @if($attempt->time_taken_seconds) {{ gmdate('H:i:s', $attempt->time_taken_seconds) }} @endif
@if($exam->show_results_immediately && $exam->allow_review)
Answer Review
{{ $attempt->answers->count() }} questions reviewed
@foreach($attempt->answers as $i => $answer) @php $q = $answer->question; $correct = $answer->is_correct; $isEssay = in_array($q->type, ['essay', 'short_answer']); @endphp
Q{{ $i+1 }} @if(!is_null($correct)) {{ $correct ? '+' . $answer->marks_awarded : '0' }}/{{ $q->marks }} marks @else Manual grading required @endif

{{ $q->question_text }}

@if($answer->selectedOption)
Your Answer: {{ $answer->selectedOption->option_text }}
@if(!$correct && $q->correctOption())
Correct Answer: {{ $q->correctOption()->option_text }}
@endif @elseif($answer->text_answer)
Your Answer:
{{ $answer->text_answer }}
@endif @if($q->explanation)
Explanation
{{ $q->explanation }}
@endif
@endforeach
@else
Answer review is not available for this exam.
@endif
Back to Dashboard @if($exam->allow_review && !$exam->show_results_immediately) Results will be emailed to you shortly. @endif
@endsection