@extends('layouts.app') @section('title', __('Рейтинг преподавателей')) @php $fmtDate = fn (string $d) => date('d.m.Y', strtotime($d)); $cell = fn (?float $v) => $v === null ? '—' : (string) round($v); $tone = fn (?float $v) => $v === null ? 'text-muted' : ($v >= 80 ? 'text-success' : ($v >= 60 ? '' : 'text-danger')); $tip = function (string $key, array $raw): string { return match ($key) { 'retention' => __('Остались :stayed из :students учеников', ['stayed' => $raw['stayed'], 'students' => $raw['students']]), 'attendance' => __('Пришли :attended из :counted отметок', ['attended' => $raw['attended'], 'counted' => $raw['counted']]), 'results' => __('Оценок: :n', ['n' => $raw['marks']]), 'discipline' => __('Уроков: :conducted, задним числом: :backfills, замен: :covered', ['conducted' => $raw['conducted'], 'backfills' => $raw['backfills'], 'covered' => $raw['covered']]), 'nps' => __('Ответов: :total, высоких (9–10): :promoters, низких (0–6): :detractors', ['total' => $raw['nps_total'], 'promoters' => $raw['promoters'], 'detractors' => $raw['detractors']]), }; }; $sample = fn (string $key, array $raw) => match ($key) { 'retention' => $raw['students'], 'attendance' => $raw['counted'], 'results' => $raw['marks'], 'discipline' => $raw['conducted'] + $raw['covered'], 'nps' => $raw['nps_total'], }; @endphp @section('content')

{{ __('Рейтинг преподавателей') }}

←
@if ($nextYm) → @endif CSV

{{ __('За :fmtdate – :fmtdate2 (90 дней); сравнение с :fmtdate3 – :fmtdate4. Каждый показатель — от 0 до 100, балл — их среднее. Показатель с малым числом данных не учитывается (—).', ['fmtdate' => $fmtDate($window[0]), 'fmtdate2' => $fmtDate($window[1]), 'fmtdate3' => $fmtDate($prevWindow[0]), 'fmtdate4' => $fmtDate($prevWindow[1])]) }}

@if ($rows === [])
{{ __('За этот период нет уроков и групп.') }}
@else
@foreach ($components as $label) @endforeach @foreach ($rows as $row) @foreach ($components as $key => $label) @endforeach @endforeach
{{ __('Место') }}{{ __('Преподаватель') }}{{ __('Балл') }}{{ $label }}
@if ($row['place'] !== null) {{ $row['place'] }} @if ($row['prevPlace'] !== null && $row['prevPlace'] !== $row['place']) @php $moved = $row['prevPlace'] - $row['place']; @endphp {{ $moved > 0 ? '▲' : '▼' }}{{ abs($moved) }} @endif @else — @endif {{ $row['name'] }} @if ($row['score'] === null) {{ __('мало данных') }} @else {{ round($row['score']) }} @if ($row['prevScore'] !== null) @php $d = (int) round($row['score'] - $row['prevScore']); @endphp {{ $d > 0 ? '▲+'.$d : ($d < 0 ? '▼'.$d : '•0') }} @endif @endif {{ $cell($row['components'][$key]) }} n={{ $sample($key, $row['raw']) }}
@endif
@endsection