@extends('dashboard.layouts.master') @section('content')

{{$exam->level->name}} إمتحان

@if(isset($user_exam) && !empty($user_exam) && now() >= \Illuminate\Support\Carbon::parse($user_exam->created_at)->addHours(3)) إعاده الامتحان @endif
@if(isset($user_exam) && !empty($user_exam))

عدد الاسئله :

{{@$user_exam->answers->count()}}

عدد الاجابات الصحيحه :

{{@$user_exam->correct_answer_count}}

عدد الاجابات الخطأ :

{{@$user_exam->wrong_answer_count}}

نتيجه الإمتحان :

{{@$user_exam->result}} %

حاله الطالب :

{{@$user_exam->is_passed ?'ناجح':'راسب'}}
@foreach($user_exam->answers as $index => $answer) @endforeach
# السؤال إجابه الطالب الاجابه الصحيحه هل الإجابه صحيحه ؟
{{++$index}} {!! @$answer->question->question !!} {{$answer->user_answer}} {{$answer->answer}}
{{-- @foreach($exam->questions as $index=> $question) @if($question->type =='choice')
@foreach($question->choices as $choice) is_correct ? 'checked':""}} value="{{$choice->choice}}" type="radio" placeholder=""> @endforeach @error('answers.'.$question->id.'.answer') {{$message}} @enderror
@elseif($question->type =='paragraph')
@error('answers.'.$question->id.'.answer') {{$message}} @enderror
@endif @endforeach--}}
@else
@csrf
@foreach($exam->questions as $index=> $question) @if($question->type =='choice')

{!! $question->question !!}

@foreach($question->choices as $choice)
is_correct ? 'checked':""}} value="{{$choice->choice}}" type="radio" placeholder="">
@endforeach @error('answers.'.$question->id.'.answer') {{$message}} @enderror
@elseif($question->type =='paragraph')

{!! $question->question !!}

@error('answers.'.$question->id.'.answer') {{$message}} @enderror
@endif @endforeach
@endif
@endsection @push('js') @endpush