@php // Keyed by procedure id, never by a running counter. A counter passed into // an @include is copied, not shared, so each section would restart at zero // and every section's rows would collide on both form keys and DOM ids. $key = $procedure->id; $latest = $latestMap[$procedure->id] ?? null; $name = "assessments[{$key}]"; $isPassed = (bool) $latest?->isPassing(); $state = $isPassed ? 'passed' : ($latest ? 'retry' : 'pending'); $allowNA = $allowNA ?? false; @endphp {{ $rowNum }} {{ $procedure->name }} @if($latest) @if($latest->is_na) NA @else {{ $latest->score }} @endif
{{ $latest->assessment_date->format('d M y') }}
@else @endif @unless($allowNA) @endunless
@foreach([1, 2, 3, 4, 5] as $s) @endforeach @if($allowNA) @endif