@extends('student.layouts.app') @section('title', app()->getLocale() === 'ar' ? 'الدرجات' : 'Marks') @section('content') @php $isArabic = app()->getLocale() === 'ar'; $recordedMarks = $marks->filter(fn ($mark) => ! $mark->students->first()?->absent); $averageScore = $recordedMarks->count() ? round($recordedMarks->avg(function ($mark) { $studentMark = $mark->students->first(); $totalScore = max(1, (float) $mark->score); return (($studentMark?->mark ?? 0) / $totalScore) * 100; })) : 0; @endphp
@include('student.courses.inc.overview', ['course' => $course]) @include('student.courses.inc.tabs', ['course' => $course])
{{ $isArabic ? 'إجمالي البنود' : 'Total items' }}
{{ $marks->count() }}
{{ $isArabic ? 'نتائج مسجلة' : 'Recorded results' }}
{{ $recordedMarks->count() }}
{{ $isArabic ? 'متوسط الأداء' : 'Average performance' }}
{{ $averageScore }}%

{{ $isArabic ? 'سجل الدرجات' : 'Marks record' }}

{{ $isArabic ? 'عرض منظم لكل درجة منشورة داخل المادة مع حالتها.' : 'An organized view of every published mark in this course.' }}

@foreach($marks as $mark) @php $studentMark = $mark->students->first(); $studentPercentage = $studentMark && ! $studentMark->absent ? round((($studentMark->mark ?? 0) / max(1, (float) $mark->score)) * 100) : null; @endphp @endforeach @if(($marks)->isEmpty()) @endif
{{ $isArabic ? 'العنوان' : 'Title' }} {{ $isArabic ? 'الدرجة النهائية' : 'Total' }} {{ $isArabic ? 'درجتك' : 'Your mark' }} {{ $isArabic ? 'الحالة' : 'Status' }} {{ $isArabic ? 'التاريخ' : 'Date' }}
{{ $mark->title }} {{ $mark->score }} {{ $studentMark?->mark ?? 0 }} @if (! is_null($studentPercentage)) {{ $studentPercentage }}% @endif @if ($studentMark?->absent) {{ __('dashboard.Absent') }} @else {{ $isArabic ? 'مسجلة' : 'Recorded' }} @endif {{ $mark->date?->format('Y-m-d') ?? $mark->created_at?->format('Y-m-d') }}
{{ $isArabic ? 'لم يتم إضافة أي درجات بعد.' : 'No marks have been published yet.' }}
@endsection