@php $filtersOpen = request()->hasAny(['keyword', 'subject_id', 'lesson_id', 'teacher_id', 'type', 'difficulty_level_id']); $pageTitle = $pageTitle ?? __('dashboard.Question Bank'); $pageHeading = $pageHeading ?? __('dashboard.All Questions'); $pageDescription = $pageDescription ?? __('dashboard.Question bank subtitle'); $routePrefix = $routePrefix ?? 'admin'; $indexRoute = $indexRoute ?? $routePrefix . '.questions.index'; $createRoute = $createRoute ?? $routePrefix . '.questions.create'; $showTeacherFilter = $showTeacherFilter ?? false; $bankView = $bankView ?? ($routePrefix === 'teacher' ? 'teacher_scope' : 'admin'); $isTeacherBank = str_starts_with($bankView, 'teacher'); $showAuthorColumn = ! $isTeacherBank; $creatorScope = request('creator_scope', 'all'); $stats = $questionBankData['stats']; $typeBreakdown = $questionBankData['type_breakdown']; $difficultyBreakdown = $questionBankData['difficulty_breakdown']; $subjectCards = $questionBankData['subject_cards']; $previewSubject = $questionBankData['preview_subject']; $previewQuestions = $questionBankData['preview_questions']; $previewSubjectStats = $questionBankData['preview_subject_stats']; $typeLabels = $questionBankData['type_labels']; $typeIcons = $questionBankData['type_icons']; $isArabic = app()->getLocale() === 'ar'; $teacherScopeFilters = $isTeacherBank ? [ [ 'label' => $isArabic ? ($bankView === 'subject_head_scope' ? 'كل أسئلة القسم' : 'كل الأسئلة المتاحة') : ($bankView === 'subject_head_scope' ? 'All Department Questions' : 'All Available Questions'), 'route' => route($indexRoute, array_merge(request()->except(['page', 'creator_scope']), ['creator_scope' => 'all'])), 'active' => $creatorScope !== 'mine', ], [ 'label' => $isArabic ? ($bankView === 'subject_head_scope' ? 'أسئلة رئيس القسم' : 'أسئلتي المنشأة') : ($bankView === 'subject_head_scope' ? 'Head Created Questions' : 'My Created Questions'), 'route' => route($indexRoute, array_merge(request()->except(['page', 'creator_scope']), ['creator_scope' => 'mine'])), 'active' => $creatorScope === 'mine', ], ] : []; $resetQuery = array_filter([ 'preview_subject_id' => request('preview_subject_id'), 'creator_scope' => $isTeacherBank ? $creatorScope : null, ]); @endphp @if($isTeacherBank)

{{ $pageTitle }}

{{ $pageHeading }}

{{ $pageDescription }}

{{ $isArabic ? 'الأسئلة المتاحة لك' : 'Questions in your reach' }}

{{ $stats['total_questions'] }}

{{ __('dashboard.Add New Question') }}
@foreach($teacherScopeFilters as $filter) {{ $filter['label'] }} @endforeach

{{ $isArabic ? 'إحصائيات البنك' : 'Bank statistics' }}

{{ $isArabic ? 'ملخص سريع لبنك الأسئلة' : 'Quick question bank summary' }}

{{ $isArabic ? 'مؤشرات سريعة تساعدك على فهم التغطية الحالية داخل موادك قبل اختيار الأسئلة.' : 'Fast indicators to understand current coverage across your subjects before choosing questions.' }}

{{ $isArabic ? 'إجمالي الأسئلة' : 'Total questions' }}

{{ $stats['total_questions'] }}

{{ $isArabic ? 'المواد المغطاة' : 'Covered subjects' }}

{{ $stats['total_subjects'] }}

{{ $isArabic ? 'تصحيح تلقائي' : 'Auto corrected' }}

{{ $stats['auto_corrected_questions'] }}

{{ $isArabic ? 'تصحيح يدوي' : 'Manual review' }}

{{ $stats['manual_review_questions'] }}

{{ $isArabic ? 'أسئلة بوسائط' : 'Media questions' }}

{{ $stats['questions_with_media'] }}

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

{{ $isArabic ? 'أسئلة المواد' : 'Subject questions' }}

{{ $isArabic ? 'أسئلة المواد المتاحة للمدرس' : 'Questions available to the teacher' }}

{{ $isArabic ? 'اختر مادة من البطاقات التالية لمراجعة أسئلتها، أو اترك الفلاتر عامة لعرض كل الأسئلة المتاحة لك.' : 'Pick a subject from the cards below to review its questions, or keep filters broad to view all questions available to you.' }}

@if($previewSubject && $previewSubjectStats)

{{ $previewSubject->name }}

{{ $previewSubjectStats['total_questions'] }} {{ $isArabic ? 'سؤالاً في المادة المختارة' : 'questions in the selected subject' }}

@endif
@if($subjectCards->isEmpty())
{{ $isArabic ? 'لا توجد مواد أو أسئلة متاحة حالياً داخل نطاقك.' : 'There are no available subjects or questions in your current scope.' }}
@else @endif

{{ $isArabic ? 'القائمة الحالية' : 'Current list' }}

{{ $isArabic ? 'الأسئلة الجاهزة للمراجعة' : 'Questions ready for review' }}

{{ $isArabic ? 'هذه القائمة تعكس المادة المختارة والفلاتر الحالية مباشرة.' : 'This list directly reflects the selected subject and current filters.' }}

@if($questions->isEmpty())
{{ __('dashboard.No data found') }}
@else
@foreach($questions as $question) @endforeach
{{ $isArabic ? 'السؤال' : 'Question' }} {{ $isArabic ? 'النوع' : 'Type' }} {{ $isArabic ? 'المادة والدرس' : 'Subject & lesson' }} {{ $isArabic ? 'الصعوبة والدرجة' : 'Difficulty & score' }} {{ __('dashboard.Actions') }}

{{ $question->question_text }}

#{{ $question->id }}

{{ $typeLabels[$question->type] ?? $question->type }}

{{ $question->subject?->name ?? '-' }}

{{ $question->lesson?->title ?? '-' }}

{{ $question->difficultyLevel?->name ?? ($isArabic ? 'غير محدد' : 'Unspecified') }}

{{ $question->score ?? 0 }}

{{ $questions->appends(request()->query())->links('pagination::simple-tailwind') }}
@endif
@else

{{ $pageTitle }}

{{ $pageHeading }}

{{ $pageDescription }}

{{ $isArabic ? 'إجمالي الأسئلة' : 'Total questions' }}

{{ $stats['total_questions'] }}

{{ __('dashboard.Add New Question') }}

{{ $isArabic ? 'ملخص البنك' : 'Bank overview' }}

{{ $isArabic ? 'وضع بنك الأسئلة' : 'Question bank status' }}

{{ $isArabic ? 'إحصاءات مباشرة عن التغطية والأنواع والتصحيح والوسائط.' : 'Direct metrics for coverage, types, correction mode, and media usage.' }}

{{ $isArabic ? 'المواد المغطاة' : 'Covered subjects' }}

{{ $stats['total_subjects'] }}

{{ $isArabic ? 'متوسط الدرجة' : 'Average score' }}

{{ $stats['average_score'] }}

{{ $isArabic ? 'تصحيح يدوي' : 'Manual review' }}

{{ $stats['manual_review_questions'] }}

{{ $isArabic ? 'تصحيح تلقائي' : 'Auto corrected' }}

{{ $stats['auto_corrected_questions'] }}

{{ $isArabic ? 'بها وسائط' : 'With media' }}

{{ $stats['questions_with_media'] }}

@if($showTeacherFilter) @endif
{{ __('dashboard.Reset') }}

{{ $isArabic ? 'خريطة المواد' : 'Subjects map' }}

{{ $isArabic ? 'المواد المتاحة للمعاينة' : 'Subjects available for preview' }}

{{ $isArabic ? 'اختر مادة واحدة لعرض معاينة سريعة وإحصاءاتها.' : 'Choose a subject to preview recent questions and related metrics.' }}

@if($subjectCards->isEmpty())
{{ $isArabic ? 'لا توجد مواد متاحة داخل هذا النطاق حالياً.' : 'No subjects are available in the current scope.' }}
@else @endif

{{ $isArabic ? 'قائمة الأسئلة' : 'Questions list' }}

{{ $isArabic ? 'الأسئلة الحالية' : 'Current questions' }}

{{ $isArabic ? 'الأسئلة الظاهرة تعكس الفلاتر الحالية مباشرة.' : 'The visible questions reflect the active filters directly.' }}

@if($questions->isEmpty())
{{ __('dashboard.No data found') }}
@else
@if($showAuthorColumn) @endif @foreach($questions as $question) @if($showAuthorColumn) @endif @endforeach
{{ $isArabic ? 'السؤال' : 'Question' }} {{ $isArabic ? 'النوع' : 'Type' }} {{ $isArabic ? 'المادة والدرس' : 'Subject & lesson' }} {{ $isArabic ? 'الصعوبة والدرجة' : 'Difficulty & score' }}{{ $isArabic ? 'المنشئ' : 'Author' }}{{ __('dashboard.Actions') }}

{{ $question->question_text }}

#{{ $question->id }}

{{ $typeLabels[$question->type] ?? $question->type }}

{{ $question->subject?->name ?? '-' }}

{{ $question->lesson?->title ?? '-' }}

{{ $question->difficultyLevel?->name ?? ($isArabic ? 'غير محدد' : 'Unspecified') }}

{{ $question->score ?? 0 }}

{{ trim(($question->user?->first_name ?? '') . ' ' . ($question->user?->last_name ?? '')) ?: '-' }}
{{ $questions->appends(request()->query())->links('pagination::simple-tailwind') }}
@endif

{{ $isArabic ? 'المعاينة السريعة' : 'Quick preview' }}

{{ $isArabic ? 'آخر أسئلة المادة المختارة' : 'Latest questions in the selected subject' }}

{{ $isArabic ? 'عرض مباشر لآخر الأسئلة المرتبطة بالمادة الجاري معاينتها.' : 'A direct snapshot of the latest questions linked to the currently previewed subject.' }}

@if($previewQuestions->isEmpty())
{{ $isArabic ? 'لا توجد أسئلة للمعاينة داخل هذه المادة حالياً.' : 'No preview questions are available for this subject yet.' }}
@else
@foreach($previewQuestions as $question) @endforeach
{{ $isArabic ? 'السؤال' : 'Question' }} {{ $isArabic ? 'النوع' : 'Type' }} {{ $isArabic ? 'الدرس' : 'Lesson' }} {{ $isArabic ? 'الصعوبة' : 'Difficulty' }} {{ $isArabic ? 'الدرجة' : 'Score' }} {{ $isArabic ? 'إجراء' : 'Action' }}

{{ $question->question_text }}

{{ trim(($question->user?->first_name ?? '') . ' ' . ($question->user?->last_name ?? '')) ?: '-' }}

{{ $typeLabels[$question->type] ?? $question->type }} {{ $question->lesson?->title ?? '-' }} {{ $question->difficultyLevel?->name ?? ($isArabic ? 'غير محدد' : 'Unspecified') }} {{ $question->score ?? 0 }} {{ __('dashboard.View') }}
@endif
@endif