@if(empty($topics) || count($topics) === 0)

No Missions Yet!

There are no coding missions published for this level yet. Check back soon!

@else
@foreach($topics as $index => $topic) @php $pct = max(0, min(100, (int) ($topic->progress_percentage ?? 0))); $starsLit = $pct >= 100 ? 3 : ($pct >= 66 ? 2 : ($pct >= 25 ? 1 : 0)); $cDone = (int) ($topic->coding_completed ?? 0); $cTotal = (int) ($topic->coding_count ?? 0); $mDone = (int) ($topic->mcq_completed ?? 0); $mTotal = (int) ($topic->mcq_count ?? 0); $isDone = ($pct >= 100); $stepLabel = str_pad((string) ($index + 1), 2, '0', STR_PAD_LEFT); @endphp
@csrf
Mission {{ $stepLabel }}

{{ $topic->topic }}

Puzzles {{ $cDone }}/{{ $cTotal }}
Quizzes {{ $mDone }}/{{ $mTotal }}
{{ $pct }}% Done {{ $isDone ? 'Replay!' : ($pct > 0 ? 'Keep Going!' : 'Play Now!') }}
@endforeach
@endif