{{-- The mental math game for a logged-in user. Students get it inside the gamification tabs, with their saved rounds below; any other role gets the plain site layout and can play, but nothing is saved. Guests get math_game/guest. --}} @extends($isStudent ? 'layouts.gamification' : 'layouts.app') @section('title', __('Устный счёт')) @section('gami-active', 'math') @section($isStudent ? 'gami-content' : 'content') @include('math_game._game', ['saveMode' => $isStudent ? 'student' : 'other', 'duel' => $duel]) @if ($isStudent) @php $opSymbols = ['add' => '+', 'sub' => '−', 'mul' => '×', 'div' => '÷', 'sq' => 'x²']; $difficultyLabels = [1 => __('Лёгкий'), 2 => __('Средний'), 3 => __('Сложный')]; @endphp
{{ __('Мои результаты') }}🏆 {{ __('Рейтинг игры') }}
@if (empty($results))
{{ __('Сыграйте первый раунд — результат появится здесь.') }}
@else @if (! empty($best))
@foreach ($difficultyLabels as $level => $label) @isset($best[$level]) {{ __(':label: рекорд :best в минуту', ['label' => $label, 'best' => $best[$level]]) }} @endisset @endforeach
@endif
@foreach ($results as $r) @endforeach
{{ __('Дата') }}{{ __('Действия') }}{{ __('Сложность') }}{{ __('Время') }}{{ __('Верно') }}
{{ \Illuminate\Support\Carbon::parse($r->created_at)->format('d.m H:i') }} {{ implode(' ', array_map(fn ($op) => $opSymbols[$op] ?? $op, explode(',', $r->ops))) }} {{ $difficultyLabels[(int) $r->difficulty] ?? $r->difficulty }} {{ (int) $r->duration >= 60 ? ((int) $r->duration / 60).__(' мин') : (int) $r->duration.__(' сек') }} {{ (int) $r->correct }}/{{ (int) $r->answered }}
@endif
@endif @endsection