@extends('layouts.app') @section('title', 'الامتحان: ' . $exam->title) @section('content')
{{-- Header --}}

الامتحان: {{ $exam->title }}

إجمالي الأسئلة: {{ $statsTotal }} | متوسط عدد الاختيارات: {{ $statsAvgOptions }}
تصدير CSV
{{-- Filters --}}
{{-- Sort bar --}} @php if (!function_exists('sortUrl')) { function sortUrl($field) { $isSame = request('sort') === $field; $nextDir = $isSame && request('direction') === 'asc' ? 'desc' : 'asc'; return request()->fullUrlWithQuery(['sort' => $field, 'direction' => $nextDir]); } } if (!function_exists('sortIcon')) { function sortIcon($field) { if (request('sort') !== $field) { return ''; } return request('direction') === 'asc' ? '↑' : '↓'; } } @endphp
فرز حسب: التاريخ {!! sortIcon('created_at') !!} السؤال {!! sortIcon('question') !!}
{{-- Questions Table --}}
@forelse($questions as $q) @php $answers = is_array($q->answers) ? $q->answers : (json_decode($q->answers ?? '[]', true) ?: []); @endphp {{-- Edit Modal (per-row, no JS injection needed) --}} @empty @endforelse
# السؤال الاختيارات الإجابة الصحيحة أُنشئ في إجراءات
{{ $q->id }}
{{ Str::limit($q->question, 160) }}
@if (!empty($answers))
    @foreach ($answers as $k => $v)
  • {{ $k }} {{ $v }}
  • @endforeach
@else @endif
{{ $q->correct_answer }} {{ optional($q->created_at)->format('Y-m-d H:i') }}
@csrf @method('DELETE') {{-- توريث الاستعلامات --}}
لا توجد أسئلة مطابقة.
{{-- Pagination --}}
{{ $questions->links() }}
{{-- Create Modal (no JS) --}}
@endsection