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

{{ __('admin.quiz_attempts') }} #{{ $attempt->id }}

{{ $attempt->student?->name ?? '—' }} — {{ $attempt->quiz?->title ?? '—' }}
@csrf
{{ __('admin.back') }}
{{ __('admin.score') }}
{{ $attempt->score ?? 0 }} / {{ $attempt->max_score ?? 0 }}
{{ __('admin.status') }}
{{ $attempt->status ?? '—' }}
{{ __('admin.student_2') }}
{{ $attempt->student?->email ?? '—' }}
{{ __('admin.quiz') }}
{{ $attempt->quiz?->title ?? '—' }}
@foreach($attempt->answers ?? [] as $i => $ans) @php $q = $ans->question; $correct = $correctMap[$q->id] ?? null; @endphp
Q{{ $i+1 }}. {{ $q->question_text ?? '' }}{{ $ans->is_correct ? 'Correct' : 'Wrong' }}
{{ __('admin.points') }}: {{ $ans->points_awarded ?? 0 }} / {{ $q->points ?? 0 }}
{{ __('admin.your_answer') }}: {{ $ans->selectedOption?->option_text ?? ($ans->answer_true_false === null ? '—' : ($ans->answer_true_false ? 'True' : 'False')) }}
@if(($q->type ?? '') === 'mcq')
{{ __('admin.correct') }}: {{ optional(optional($correct)->options->first())->option_text ?? '—' }}
@endif
@endforeach
@endsection