@extends('layout.layout') @php($assessmentResults = $assessmentResults ?? []) @php($score = (float) ($assessmentResults['score'] ?? $submission->score ?? 0)) @php($totalMarks = (float) ($assessmentResults['total_marks'] ?? $submission->total_marks ?? 0)) @php($percentage = array_key_exists('percentage', $assessmentResults) ? (float) $assessmentResults['percentage'] : ($submission->percentage !== null ? (float) $submission->percentage : ($totalMarks > 0 ? ($score / $totalMarks) * 100 : 0))) @php($accuracy = (float) ($assessmentResults['accuracy'] ?? $submission->accuracy ?? 0)) @php($passed = array_key_exists('passed', $assessmentResults) ? (bool) $assessmentResults['passed'] : (bool) $submission->passed) @push('styles') @endpush @section('content')

Exam Results

Back to Exams
Time Taken
{{ $submission->time_taken_seconds ?? 0 }}s
Score
{{ number_format($score, 2) }} / {{ number_format($totalMarks, 2) }}
Percentage
{{ number_format($percentage, 2) }}%
{{ number_format($accuracy, 2) }}% answer accuracy
Status
{{ $passed ? 'Pass' : 'Fail' }}

Answer Details

{{ count($feedback) }} {{ \Illuminate\Support\Str::plural('question', count($feedback)) }}
@forelse ($feedback as $item)
Question {{ $loop->iteration }}
{{ $item['question'] ?? '' }}
{{ !empty($item['is_correct']) ? 'Correct' : 'Wrong' }}
Your Answer
{{ is_array($item['answer'] ?? null) ? implode(', ', $item['answer']) : ($item['answer'] ?? 'N/A') }}
@foreach (($item['children'] ?? []) as $child)
Sub-question {{ $loop->iteration }}
{{ $child['question'] ?? '' }}
{{ !empty($child['is_correct']) ? 'Correct' : 'Wrong' }}
Your Answer
{{ is_array($child['answer'] ?? null) ? implode(', ', $child['answer']) : ($child['answer'] ?? 'N/A') }}
@endforeach
@empty
No feedback is available for this submission.
@endforelse
@endsection @push('scripts') @endpush