@extends('layouts.admin') @section('title', 'View Question #' . $question->id) @push('styles') @endpush @section('content')
{{-- Page Header --}} @include('admin.components.page-header', [ 'title' => 'View Question' . ($question->is_diagnostic ? ' ⚡' : ''), 'subtitle' => 'Question ID: ' . $question->id . ' | Type: ' . ($question->type->type ?? 'Unknown') . ($question->is_diagnostic ? ' | ' . 'SENTINEL' : ''), 'breadcrumbs' => [ ['title' => 'Dashboard', 'url' => url('/admin')], ['title' => 'Questions', 'url' => route('admin.questions.index')], ['title' => 'View Question'] ], 'actions' => [ ['text' => 'QA Review', 'url' => route('admin.qa.questions.review', $question), 'icon' => 'clipboard-check', 'style' => 'warning'], ['text' => 'Duplicate Question', 'onclick' => 'duplicateQuestion(' . $question->id . ')', 'icon' => 'copy', 'style' => 'info'], ['text' => 'Delete Question', 'onclick' => 'deleteQuestion(' . $question->id . ')', 'icon' => 'trash', 'style' => 'danger'] ] ])
{{-- MAIN --}}
{{-- Question Content --}}
Question Content {{ $question->type->type ?? 'Unknown Type' }}
{{-- Question Image --}}
@if($question->question_image)
Question Image
@else
Upload Question Image

Click to browse or drag and drop

Supports: JPG, PNG, GIF, WebP (Max 6MB)

@endif
{{-- QUESTION TEXT (HTML + KaTeX) --}}
@if($question->type->type != "MCQ") Blanks: 0 / 4 @endif
{!! $question->question !!}
Supports HTML and KaTeX.
{{-- ANSWERS --}} @if((int)$question->type_id === 1) {{-- ===== Type 1: MCQ with answer images ===== --}} @php $options = [ ['label'=>'A','key'=>'answer0','index'=>0], ['label'=>'B','key'=>'answer1','index'=>1], ['label'=>'C','key'=>'answer2','index'=>2], ['label'=>'D','key'=>'answer3','index'=>3], ['label'=>'E','key'=>'answer4','index'=>4], ]; @endphp
@foreach($options as $o) @php $val = $question->{$o['key']} ?? ''; $img = $question->{$o['key'].'_image'} ?? null; $isCorrect = (string)$question->correct_answer === (string)$o['index']; @endphp
{{ $o['label'] }} @if($isCorrect) @endif
{{-- Rich text / KaTeX --}}
{!! $val !!}
{{-- Optional image --}} @if($img)
Option {{ $o['label'] }}
@else
Add Image for {{ $o['label'] }}
@endif
@endforeach {{-- Correct answer dropdown --}}
@elseif((int)$question->type_id === 2) {{-- ===== Type 2: FIB – text only, no images or correct_answer ===== --}}
@for($i = 0; $i < 4; $i++) @php $val = $question->{'answer'.$i} ?? ''; @endphp @if ($val)
{!! $val !!}
@endif @endfor
@endif {{-- Settings --}}
{{-- Explanation / Hints / Solutions --}}
Explanation, Hints & Solutions
{{-- Explanation --}}
{!! $question->explanation !!}
{{-- Hints --}}
@if($question->hints && $question->hints->count() > 0) @foreach($question->hints->sortBy('hint_level') as $hint)
Level
Hint Text
{!! $hint->hint_text !!}
@if($hint->user) Added by {{ $hint->user->name }} @endif
@endforeach @else

No hints available

@endif {{-- Add hint --}}
{{-- Solutions --}}
@if($question->solutions && $question->solutions->count() > 0) @foreach($question->solutions as $solution)
Solution
{!! $solution->solution !!}
By {{ $solution->user->name ?? 'Unknown' }} on {{ optional($solution->created_at)->format('M d, Y') }}
@endforeach @else

No solutions available

@endif {{-- Add solution --}}
{{-- SIDEBAR --}}
{{-- Stats --}}
Question Statistics

{{ $question->id }}

Question ID

0

Times Used

0%

Accuracy
{{-- Quick Actions --}}
Quick Actions
QA Review
@include('admin.components.math-help')
{{-- Skill --}}
Associated Skill
@if($question->skill)
@if($question->skill->image) {{ $question->skill->skill }} @endif
{{ $question->skill->skill }} View Skill

{{ strlen($question->skill->description) > 100 ? substr($question->skill->description, 0, 100) . '...' : $question->skill->description }}

Change Skill
Select a new skill to assign to this question
@else

No skill associated

@endif
{{-- QA Issues --}}
QA Issues
{{ $question->qaIssues->count() }}
@if($question->qaIssues->isEmpty())

No QA issues recorded for this question.

@else
@foreach($question->qaIssues as $issue)
{{ $issue->status }} {{ str_replace('_',' ', $issue->issue_type) }} {{ $issue->description }}
Reported by {{ optional($issue->reviewer)->name ?? 'Reviewer '.$issue->reviewer_id }} on {{ optional($issue->created_at)->format('M j, Y') }}
@endforeach
@endif
{{-- Image Preview Modal --}}
Image Preview
Preview
@endsection @push('scripts') @endpush