@extends('admin.layout.app') @section('body')

{{ __('admin.result') }}: {{ $attempt->quiz->title }}

{{ __('admin.attempt') }}#{{ $attempt->id }}
{{ __('admin.back') }}
@if(session('msg'))
{{ session('msg') }}
@endif
{{ __('admin.score') }}: {{ $attempt->score ?? 0 }} / {{ $attempt->max_score ?? 0 }}
{{ __('admin.status') }}: {{ $attempt->status }}
{{ __('admin.submitted') }}: {{ $attempt->submitted_at?->format('Y-m-d H:i') ?? '—' }}
{{ __('admin.graded') }}: {{ $attempt->graded_at?->format('Y-m-d H:i') ?? '—' }}
@foreach($attempt->answers as $i => $ans) @php $q = $ans->question; $correctText = ''; if ($q->type === 'mcq') { // correct option not loaded here; show selected only (admin has correct map) } else { $correctText = $q->correct_true_false === null ? '—' : ($q->correct_true_false ? 'True' : 'False'); } @endphp
Q{{ $i+1 }}. {!! nl2br(e($q->question_text)) !!}
{{ $ans->is_correct ? 'Correct' : 'Wrong' }}
{{ __('admin.points') }} {{ $ans->points_awarded ?? 0 }} / {{ $q->points }}
@if($q->type === 'mcq')
{{ __('admin.your_answer') }} {{ $ans->selectedOption?->option_text ?? '—' }}
@else
{{ __('admin.your_answer') }} {{ $ans->answer_true_false === null ? '—' : ($ans->answer_true_false ? 'True' : 'False') }}
{{ __('admin.correct') }} {{ $correctText }}
@endif
@endforeach
@endsection