@extends('components.dashboard.layouts.master') @section('title', __('Submission Details')) @section('styles') @endsection @section('content')
{{ __('Submission Details') }}
{{-- Header meta --}}
{{ __('Exam') }}:

{{ $submission->exam->title ?? ('#'.$submission->exam_id) }}

{{ __('Student') }}:

{{ $submission->student->name ?? '-' }}

{{ __('Submitted At') }}:

{{ $submission->updated_at }}


{{-- Questions table --}}
@foreach($submission->spacificStudentSubmissionQuestions as $idx => $row) @php $q = $row->question; $isMcq = $q && $q->question_type === 'mcq'; $studentOptionId = $isMcq ? (string)($row->answer ?? '') : null; $questionImg = $q->getFirstMediaUrl('image') ?? null; $correctAnswerText = $isMcq ? optional($q->options->firstWhere('is_correct',1))->answer : $q->answer; @endphp @endforeach
# {{ __('Question') }}
{{ $idx + 1 }}
{{ $q->question_text ?? '-' }}
@if($questionImg) {{ __('Question Image') }} @endif {{-- Meta --}}
{{ __('Question Type') }} {{ __($q->question_type ?? '-') }}
{{ __('Question Score') }} {{ $q->score ?? 0 }}
{{ __('Difficulty Level') }} @php $diffChip = match($q->difficulty_level ?? null) { 'easy' => 'badge-green', 'medium' => 'badge-gray', 'hard' => 'badge-red', default => 'badge-gray', }; @endphp {{ __($q->difficulty_level ?? '-') }}
{{-- MCQ options --}} @if($isMcq && $q->options && $q->options->count())
{{ __('Choices') }}:
@foreach ($q->options as $opt) @php $isCorrect = (bool) $opt->is_correct; $isChosen = (string)$opt->id === $studentOptionId; $optImg = $opt->getFirstMediaUrl('answers_image') ?? null; $class = ''; if($isCorrect){ $class = 'highlight-correct'; } elseif($isChosen && !$isCorrect){ $class = 'highlight-wrong'; } @endphp
@if($optImg) {{ __('Option Image') }} @endif
{{ $opt->answer }}
@endforeach
@elseif(!$isMcq && !empty($q->answer)) {{-- Non-MCQ answer --}}
{{ __('Correct Answer') }}: {{ $q->answer }}
@if($row->answer)
{{ __('Student Answer') }}: {{ $row->answer }}
@endif @endif
{{-- /card-body --}}
{{-- GLOBAL Image Modal --}}
×
@endsection @section('script') @endsection