@extends('layouts.app') @section('content')

نتیجه آزمون

آزمون
{{ $attempt->exam->title }}
نمره
{{ $attempt->score }}

وضعیت: {{ $attempt->status }} • ارسال: {{ optional($attempt->submitted_at)->format('Y-m-d H:i') }}
@if(!$canSeeAnswers)
پاسخنامه هنوز فعال نیست. @if($showAt) زمان نمایش: {{ $showAt->format('Y-m-d H:i') }} @endif
@else
پاسخنامه
    @foreach($attempt->exam->questions as $q) @php($ans = $attempt->answers->firstWhere('question_id', $q->id)) @php($selected = (int)($ans->answer_json['choice_id'] ?? 0)) @php($correct = optional($q->choices->firstWhere('is_correct', true))->id)
  1. {{ $q->body }}
      @foreach($q->choices as $c)
    • {{ $c->text }} @if($c->id === $correct) صحیح @endif @if($c->id === $selected) انتخاب شما @endif
    • @endforeach
    {{ $ans && $ans->is_correct ? 'درست' : 'غلط' }} — امتیاز: {{ $ans->score ?? 0 }}
  2. @endforeach
@endif @endsection