@extends('layouts.app') @section('title', $module->title) @section('content') @include('partials.flash') arrow_back Back to {{ $course->title }} @php $minSeconds = $minSeconds ?? $module->effectiveMinSeconds(); $remaining = $completed ? 0 : max(0, (int) $minSeconds - (int) ($secondsSpent ?? 0)); $timerActive = ! $completed && (int) $minSeconds > 0 && $remaining > 0; // Interactive blocks (video / flip card / knowledge check / carousel / accordion) must be completed before finishing. $interactionCount = $module->blocks->whereIn('type', ['video', 'flip_card', 'knowledge_check', 'carousel', 'accordion'])->count(); $gateLocked = ! $completed && ($remaining > 0 || $interactionCount > 0); $currentIndex = $modules->search(fn ($m) => $m->id === $module->id); $typeLabel = [ 'content' => 'Content', 'knowledge_check' => 'Knowledge Check', 'final_assessment' => 'Final Assessment', 'certificate' => 'Certificate', ]; @endphp {{-- Modules stepper (interactive) --}}
{{ $i + 1 }}. {{ $m->title }}
{{ $typeLabel[$m->module_type] ?? 'Module' }}
{{ $isLocked ? 'div' : 'a' }}> @endforeachModule {{ $module->module_number }}
This module has no content yet.
Module completed
@elseif($timerActive)Unlocks when the timer ends — keep this open.
@elseif((int) $minSeconds > 0)Minimum time reached
@elseWork through the content, then mark it complete.
@endif