@extends('layouts.main_dashboard.app') @php($routePrefix = auth()->user()?->usesStaffPortal() ? 'teacher' : 'admin') @section('title', __('dashboard.View Quiz')) @section('page_heading', __('dashboard.View Quiz')) @section('breadcrumb') @endsection @section('actions') {{ __('dashboard.Edit') }} {{ __('dashboard.Manage Questions') }} @endsection @section('content')

{{ __('dashboard.Quiz Questions') }} ({{ $quiz->questions->count() }})

{{ __('dashboard.Total Marks') }}: {{ $quiz->total_marks }}
@forelse($quiz->questions as $quizQuestion)
{{ $loop->iteration }}. {!! $quizQuestion->question->question_text !!} {{ $quizQuestion->score }} {{ __('dashboard.Marks') }}
{{ __('dashboard.Lesson') }}: {{ $quizQuestion->question->lesson->title ?? 'N/A' }} | {{ __('dashboard.Difficulty Level') }}: {{ $quizQuestion->question->difficultyLevel->name ?? 'N/A' }}
{{ __('dashboard.Correct Answer') }}: @switch($quizQuestion->question->type) @case('MCQ') @php $mcq = $quizQuestion->question->mcqDetail; $choices = json_decode($mcq->choices, true); @endphp {{ $choices[$mcq->correct_choice] ?? 'N/A' }} @break @case('T/F') {{ $quizQuestion->question->trueFalseDetail->correct_answer ? __('dashboard.True') : __('dashboard.False') }} @break @case('Essay')

{!! nl2br(e($quizQuestion->question->essayDetail->essay_text)) !!}

@break @default {{ __('dashboard.Answer type not supported for display.') }} @endswitch
@empty

{{ __('dashboard.No questions have been added to this quiz yet.') }}

@endforelse

{{ __('dashboard.Summary') }}

{{ $quiz->title }}
@if($quiz->is_published) {{ __('dashboard.Published') }} @else {{ __('dashboard.Unpublished') }} @endif

{{ $quiz->description }}

{{ __('dashboard.Start Time') }}
{{ $quiz->start_time->format('d M, Y - h:i A') }}
{{ __('dashboard.End Time') }}
{{ $quiz->end_time->format('d M, Y - h:i A') }}
{{ __('dashboard.Duration') }}
{{ $quiz->duration }} {{ __('dashboard.Minutes') }}
@endsection