@extends('layouts.admin') @section('styles') @endsection @section('content')
@include('elements.admin-breadcrumb')
@include('elements.alert')

{{ $exam->student->full_name }}

{{ $exam->course->category->name ?? '' }} > {{ $exam->course->subcategory->name ?? '' }} > {{ $exam->course->name ?? '' }} @if (!empty($exam->topic_id)) > {{ $exam->topic->title ?? '' }} @endif

{{ date('d-m-Y H:i:s', strtotime($exam->start_exam)) }}

{{ date('d-m-Y H:i:s', strtotime($exam->end_exam)) }}

{{ ucfirst($exam->status) }}

{{ $exam->score ?? '-' }}

@foreach ($examQuestions as $key => $examQuestion)
Q.{{ $key + 1 }} - {!! $examQuestion->question->question_title !!} @if ($examQuestion->question->question_mark) ({{ $examQuestion->question->question_mark }} marks) @endif

Student Answer: @if ($examQuestion->answer) @if ($examQuestion->question->answer_type == 8) @php $selectedOption = $examQuestion->question->mcqOptions ->where('id', (int) $examQuestion->answer->answer_value) ->first(); @endphp {{ $selectedOption->title ?? 'Not Attempted' }} @else {{ $examQuestion->answer->answer_value ?? 'Not Attempted' }} @endif @endif

Correct Answer: @if ($examQuestion->question->answer_type == 8) @php $correctOption = $examQuestion->question->mcqOptions ->where('is_correct', 1) ->first(); @endphp {{ $correctOption->title ?? '-' }} @else {{ '-' }} @endif

@endforeach
@endsection @section('scripts') @endsection