{{ \App\Models\Setting::valueOf(app()->getLocale() === 'ar' ? 'site_name_ar' : 'site_name_en') ?: \App\Models\Setting::valueOf('site_name') }}
{{ app()->getLocale() === 'ar' ? 'تقرير الدرجات' : 'Marks Report' }}
{{ now()->format('Y-m-d') }}
{{ now()->format('h:i A') }}
{{ app()->getLocale() === 'ar' ? 'المقرر: ' : 'Course: ' }}{{ $course->name }}
{{ app()->getLocale() === 'ar' ? 'المادة: ' : 'Subject: ' }}{{ $course->subject?->name ?? '—' }}
{{ app()->getLocale() === 'ar' ? 'الفصل: ' : 'Class: ' }}{{ $course->schoolClass?->name ?? '—' }}
{{ app()->getLocale() === 'ar' ? 'عدد الاختبارات: ' : 'Tests: ' }}{{ $marks->count() }}
@php $allScores = $marks->flatMap(fn($m) => $m->students->whereNotNull('mark')->pluck('mark')); $avgScore = $allScores->count() ? round($allScores->avg(), 1) : null; $maxScore = $allScores->count() ? $allScores->max() : null; $minScore = $allScores->count() ? $allScores->min() : null; $totalStudents = $marks->first()?->students->count() ?? 0; $absentTotal = $marks->sum(fn($m) => $m->students->where('absent', true)->count()); @endphp
{{ app()->getLocale() === 'ar' ? 'متوسط الدرجات' : 'Avg. Score' }} {{ app()->getLocale() === 'ar' ? 'أعلى درجة' : 'Highest' }} {{ app()->getLocale() === 'ar' ? 'أدنى درجة' : 'Lowest' }} {{ app()->getLocale() === 'ar' ? 'عدد الطلاب' : 'Students' }} {{ app()->getLocale() === 'ar' ? 'إجمالي الغياب' : 'Total Absent' }}
{{ $avgScore ?? '—' }} {{ $maxScore ?? '—' }} {{ $minScore ?? '—' }} {{ $totalStudents }} {{ $absentTotal }}
@foreach($marks as $mark)
{{ $mark->title }} — {{ $mark->date?->format('Y-m-d') }}
@foreach($mark->students as $ms) @endforeach
{{ app()->getLocale() === 'ar' ? 'الطالب' : 'Student' }} {{ app()->getLocale() === 'ar' ? 'الدرجة' : 'Mark' }} {{ app()->getLocale() === 'ar' ? 'الحالة' : 'Status' }}
{{ $ms->student?->name }} {{ $ms->absent ? '—' : $ms->mark }} @if($ms->absent) {{ app()->getLocale() === 'ar' ? 'غائب' : 'Absent' }} @else @endif
@endforeach