@extends('layouts.main_dashboard.app') @section('title', app()->getLocale() === 'ar' ? 'مواد بنك الأسئلة' : 'Question Bank Subjects') @section('page_heading', app()->getLocale() === 'ar' ? 'مواد بنك الأسئلة' : 'Question Bank Subjects') @section('page_subtitle', app()->getLocale() === 'ar' ? 'استكشف المواد المغطاة داخل البنك من صفحة مستقلة وواضحة.' : 'Explore subjects covered by the bank from a separate, clearer page.') @section('skip_page_hero', true) @php $isArabic = app()->getLocale() === 'ar'; $allSubjectCards = collect($questionBankData['subject_cards']); $subjectSearch = trim((string) request('subject_search')); $subjectStage = trim((string) request('stage_name')); $subjectCards = $allSubjectCards ->filter(function ($subjectCard) use ($subjectSearch, $subjectStage) { $matchesSearch = $subjectSearch === '' || str_contains(mb_strtolower($subjectCard['name'] ?? ''), mb_strtolower($subjectSearch)) || str_contains(mb_strtolower($subjectCard['grade_name'] ?? ''), mb_strtolower($subjectSearch)); $matchesStage = $subjectStage === '' || ($subjectCard['stage_name'] ?? '') === $subjectStage; return $matchesSearch && $matchesStage; }) ->values() ->take(10); $stageOptions = $allSubjectCards->pluck('stage_name')->filter()->unique()->sort()->values(); @endphp @section('content')

{{ $isArabic ? 'مواد بنك الأسئلة' : 'Question Bank Subjects' }}

{{ $isArabic ? 'راجع المواد التي تحتوي على أسئلة داخل البنك من صفحة بسيطة تركز على الفلترة والجدول فقط.' : 'Review subjects that contain questions in the bank from a simple page focused on filtering and the table only.' }}

@include('admin.questions._navigation')

{{ $isArabic ? 'مواد بنك الأسئلة' : 'Question bank subjects' }}

{{ $isArabic ? 'اعرض المواد داخل جدول واضح مع فلترة حسب الاسم أو المرحلة.' : 'Review subjects in a clear table with filters by name or stage.' }}

{{ $isArabic ? 'إجمالي المواد' : 'Total subjects' }}

{{ $allSubjectCards->count() }}

{{ $isArabic ? 'المعروضة' : 'Visible' }}

{{ $subjectCards->count() }}

{{ $isArabic ? 'المراحل' : 'Stages' }}

{{ $stageOptions->count() }}

{{ __('dashboard.Reset') }}
@if($subjectCards->isEmpty())
{{ __('dashboard.No data found') }}
@else
@foreach($subjectCards as $subjectCard) @endforeach
{{ $isArabic ? 'المادة' : 'Subject' }} {{ $isArabic ? 'المرحلة والصف' : 'Stage & grade' }} {{ $isArabic ? 'الأسئلة' : 'Questions' }} {{ $isArabic ? 'الدروس' : 'Lessons' }} {{ $isArabic ? 'المنشئون' : 'Creators' }} {{ $isArabic ? 'متوسط الدرجة' : 'Average score' }}

{{ $subjectCard['name'] }}

{{ trim(($subjectCard['stage_name'] ?? '') . ' - ' . ($subjectCard['grade_name'] ?? ''), ' -') ?: '-' }} {{ $subjectCard['questions_count'] }} {{ $subjectCard['lessons_count'] }} {{ $subjectCard['creators_count'] }} {{ number_format((float) ($subjectCard['average_score'] ?? 0), 1) }}
@endif
@endsection