@extends('layouts.main_dashboard.app') @section('title', __('dashboard.Course Progress')) @section('page_heading', __('dashboard.Course Progress')) @section('page_subtitle', __('dashboard.Course progress subtitle')) @section('skip_page_hero', true) @section('content') @php $studentCollection = collect($students); $progressValues = collect($progressData)->values()->filter(fn ($value) => $value !== null); $averageProgress = $progressValues->count() ? round($progressValues->avg()) : 0; $highestProgress = $progressValues->count() ? $progressValues->max() : 0; $lowestProgress = $progressValues->count() ? $progressValues->min() : 0; @endphp

{{ __('dashboard.Course Progress') }}

{{ __('dashboard.Course progress subtitle') }}

{{ __('dashboard.Enrolled Students') }}

{{ number_format($studentCollection->count()) }}

{{ __('dashboard.Average Progress') }}

{{ $averageProgress }}%

{{ __('dashboard.Highest Progress') }}

{{ $highestProgress }}%

{{ __('dashboard.Selected Course') }}

{{ $course?->name ?: '—' }}

{{ __('dashboard.Selected Class') }}: {{ $course?->schoolClass?->name ?: '—' }}

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

{{ __('dashboard.Progress Results') }}

{{ __('dashboard.Results') }}: {{ number_format($studentCollection->count()) }}

@if($studentCollection->isNotEmpty() && $course)
@foreach($studentCollection as $student) @php $progress = $progressData[$student->id] ?? 0; @endphp @endforeach
# {{ __('dashboard.Student Name') }} {{ __('dashboard.Progress (%)') }}
{{ $loop->iteration }} {{ $student->name }}
{{ $progress }}%
@else

{{ __('dashboard.No students found for the selected course') }}

@endif
@endsection @section('scripts') @endsection