@extends('layouts.gamification') @section('title', __('Успеваемость')) @section('gami-active', 'progress') {{-- The student's own attendance, КР/ДЗ marks and срезы — StudentCabinetController::progress(). Each lesson shows its КТП topic and links to the courses staff linked to that topic. КР/ДЗ are shown out of the admin-configured scale (App\Support\LessonScores); срезы carry their own max_score, so they're shown (and averaged) as a percentage. --}} @php $statusLabels = [ 'attended' => [__('Был'), 'var(--ax-success-bg)', 'var(--ax-success)'], 'paid_absence' => [__('Пропуск'), 'var(--ax-danger-bg)', 'var(--ax-danger)'], 'free_absence' => [__('Пропуск (уваж.)'), 'var(--ax-info-bg)', 'var(--ax-info)'], 'holiday' => [__('Праздник'), 'var(--ax-gray-100)', 'var(--ax-text-muted)'], ]; $krMax = \App\Support\LessonScores::krMax(); $dzMax = \App\Support\LessonScores::dzMax(); $tone = fn (?float $value, float $max = 10) => $value === null ? 'cab-dim' : ($value / $max >= 0.8 ? 'cab-good' : ($value / $max >= 0.5 ? 'cab-mid' : 'cab-low')); @endphp @push('styles') @endpush @section('gami-content')
{{ $overall['total'] ? $overall['percent'].'%' : '—' }}
{{ __('посещаемость') }}
@if ($overall['krAvg'] === null) — @else {{ $overall['krAvg'] }}/{{ $krMax }} @endif
{{ __('средний балл КР') }}
@if ($overall['dzAvg'] === null) — @else {{ $overall['dzAvg'] }}/{{ $dzMax }} @endif
{{ __('средний балл ДЗ') }}
{{ $avgTestPercent === null ? '—' : $avgTestPercent.'%' }}
{{ __('средний срез') }}
@include('shared._homework', ['homework' => $homework, 'homeworkClass' => 'cab-panel'])
{{ __('📚 Мои группы') }}
@forelse ($groups as $group)
first ? 'open' : '' }}> ▶
{{ $group->discipline_name ?? $group->group_name }} @unless ($group->is_active) {{ __('завершена') }} @endunless
{{ $group->group_name }}@if ($group->teacher_name) · {{ $group->teacher_name }}@endif
{{ $group->stats['percent'] }}% {{ __('посещ.') }} {{ __('· КР') }} {{ $group->stats['krAvg'] ?? '—' }}/{{ $krMax }} {{ __('· ДЗ') }} {{ $group->stats['dzAvg'] ?? '—' }}/{{ $dzMax }}
@if ($group->lessons === [])
{{ __('Пока нет отмеченных уроков') }}
@else
{{ __('Уроков: :total · посетил: :attended', ['total' => $group->stats['total'], 'attended' => $group->stats['attended']]) }} · {{ __('пропусков: :absences · опозданий: :late', ['absences' => $group->stats['absences'], 'late' => $group->stats['late']]) }}
@foreach ($group->lessons as $lesson) @php($status = $statusLabels[$lesson->status] ?? [$lesson->status, 'var(--ax-gray-100)', 'var(--ax-text-muted)']) @endforeach
{{ __('Дата') }}{{ __('Тема') }}{{ __('Посещение') }}{{ __('КР') }}{{ __('ДЗ') }}
{{ date('d.m.Y', strtotime($lesson->lesson_date)) }} @if ($lesson->homework_text)
{{ __('Задано:') }} {{ $lesson->homework_text }}
@endif @if ($lesson->topic_title)
{{ $lesson->topic_title }}
@foreach ($lesson->courses as $course) {{ $course->icon }} {{ $course->title }} @endforeach @else — @endif
{{ $status[0] }} @if (in_array($lesson->lateness, ['Опоздал', 'Опоздал сильно'], true)) {{ mb_strtolower($lesson->lateness) }} @endif @if ($lesson->kr_score === null) — @else {{ $lesson->kr_score }}/{{ $krMax }} @endif @if ($lesson->dz_not_assigned) {{ __('не задано') }} @elseif ($lesson->dz_score === null) — @else {{ $lesson->dz_score }}/{{ $dzMax }} @endif
@endif
@empty
@include('partials._mascot', ['pose' => 'reading', 'class' => 'ax-mascot--empty']) {{ __('Вы пока не состоите ни в одной группе') }}
@endforelse
{{ __('📝 Срезы') }}
@forelse ($weeklyResults as $test) @php($pct = $test->score !== null && $test->max_score > 0 ? (float) $test->score / $test->max_score * 100 : null)
{{ date('d.m.Y', strtotime($test->lesson_date)) }}
{{ $test->teacher_name }}
@if ($test->score === null) {{ __('не сдавал') }} @else {{ $test->score }}/{{ (int) $test->max_score }} @endif
@empty
{{ __('Результатов срезов пока нет') }}
@endforelse
@endsection