{{-- /student/course_lesson.php?id= — CourseController::lesson(): the lesson itself, its pictures, tasks, materials, and «Урок пройден». Laid out like a w3schools tutorial page in Axioma's own colours: the course's table of contents on the left (a collapsible block on narrow screens), «Назад» and «Далее» above and below the lesson, sections divided by rules, code framed as «Пример» boxes (LessonText's $exampleLabel), notes as panels, and the tasks gathered in one «Проверьте себя» block at the end. --}} @extends('layouts.gamification') @section('title', $lesson->title) @section('gami-active', 'courses') @php [$images, $materials] = collect($materials)->partition(fn ($m) => \App\Services\Courses::isImage($m))->map(fn ($part) => $part->values()->all())->all(); $pct = (int) $neighbours['total'] > 0 ? (int) round($neighbours['index'] / $neighbours['total'] * 100) : 0; @endphp @push('styles') @endpush @push('scripts') @endpush @section('gami-content') @php $toc = function () use ($course, $outline, $lesson) { $html = ''; }; $prevLink = $neighbours['prev'] ? '/student/course_lesson.php?id='.$neighbours['prev']->id : null; $nextLink = $neighbours['next'] ? '/student/course_lesson.php?id='.$neighbours['next']->id : null; @endphp
{{ __('Содержание курса') }} @if ($neighbours['total'])· {{ __('Урок :n из :total', ['n' => $neighbours['index'], 'total' => $neighbours['total']]) }}@endif {!! $toc() !!}
@if ($prevLink) {{ __('Назад') }} @else {{ __('К курсу') }} @endif @if ($nextLink) {{ __('Далее') }} @endif
{{ $lesson->module_title }} @if ($neighbours['total']) {{ __('Урок :n из :total', ['n' => $neighbours['index'], 'total' => $neighbours['total']]) }} @endif @if ($done){{ __('✅ пройден') }}@endif

{{ $lesson->title }}

@if ($neighbours['total'] > 1) @else
@endif @if ($embedUrl)
@elseif ($lesson->video_url) {{ __('Смотреть видео') }} @endif @if ($lesson->body || $images)
@if ($lesson->body)
{!! \App\Support\LessonText::toHtml($lesson->body, __('Пример')) !!}
@endif @foreach ($images as $img)
{{ $img->title }} @if ($img->title)
{{ $img->title }}
@endif
@endforeach
@endif @if (! empty($tasks))

{{ __('Проверьте себя') }}

{{ count($tasks) }}

{{ __('Выберите ответ — сразу появится разбор решения.') }}

@foreach ($tasks as $i => $task)
{{ $i + 1 }}
{!! \App\Support\LessonText::toHtml($task->question) !!}
@foreach ($task->options as $j => $option) @endforeach
@endforeach
@endif @if (! empty($materials))
{{ __('Материалы') }}
@endif
@if ($prevLink) {{ __('Назад') }} @else @endif @if ($done) @if ($nextLink) {{ __('Далее') }} @else {{ __('К курсу') }} @endif @else
@csrf
@endif
@endsection