@extends('layouts.main_dashboard.app') @section('title', __('dashboard.Questions') . ' | ' . __('dashboard.Edit Question')) @section('content') @php $currentYearId = $question->subject->grade->stage->term->year->id ?? null; $currentTermId = $question->subject->grade->stage->term->id ?? null; $currentStageId = $question->subject->grade->stage->id ?? null; $currentGradeId = $question->subject->grade->id ?? null; $mcqChoices = old('choices', json_decode($question->mcq->choices ?? '[]', true) ?? []); $groupA = old('a', is_array($question->match?->group_a) ? $question->match->group_a : (json_decode($question->match->group_a ?? '[]', true) ?? [])); $groupB = old('b', is_array($question->match?->group_b) ? $question->match->group_b : (json_decode($question->match->group_b ?? '[]', true) ?? [])); $matchMap = is_array($question->match?->match) ? $question->match->match : (json_decode($question->match->match ?? '[]', true) ?? []); $oldMatchValues = old('match'); @endphp

{{ __('dashboard.Question Form') }}

{{ __('dashboard.Edit Question') }}

تحديث السؤال الحالي مع الحفاظ على نوعه ووسائطه وربطه الأكاديمي، ثم مراجعة الإجابة الصحيحة قبل الحفظ.

@csrf @method('PUT')
@if($question->media_path)

{{ __('dashboard.Current Media') }}

{{ $question->media_type ?: __('dashboard.Attachment') }}

{{ __('dashboard.Open') }}
@endif

{{ __('dashboard.Question Details') }}

الحقول الظاهرة هنا مرتبطة بنوع السؤال الحالي فقط.

@if($question->type === 'true_false')
@elseif($question->type === 'mcq')
@foreach($mcqChoices as $index => $choice)
@endforeach
@elseif($question->type === 'essay')
@elseif($question->type === 'match')
@foreach($groupA as $item)
@endforeach
@foreach($groupB as $index => $item)
@endforeach
@elseif($question->type === 'paragraph')
@elseif($question->type === 'audio_text')
{{ app()->getLocale() === 'ar' ? 'هذا السؤال يعرض ملفاً صوتياً داخل الاختبار ويطلب من الطالب كتابة الإجابة نصاً. تأكد أن الوسائط الحالية أو الجديدة ملف صوتي.' : 'This question shows an audio file in the quiz and asks the student to answer with text. Make sure the current or replacement media is an audio file.' }}
@elseif($question->type === 'text_audio')
@elseif($question->type === 'fill_blank')
{{ app()->getLocale() === 'ar' ? 'ضع [blank] في كل موضع تريد أن يظهر كفراغ للطالب.' : 'Place [blank] wherever you want a blank to appear for the student.' }}
@endif
{{ __('dashboard.Cancel') }}
@endsection @section('scripts') @endsection