{{-- field → track → skill mastery tree — port of ags_parent MathAtlasView accordion. Vars: $fields = MathSnapshotService::for()['fields'] --}} @php // 3-state dot: passed (lime) / attempted-not-passed (blue) / not attempted (gold). $dot = function ($passed, $maxile) { $c = $passed ? '#88C808' : (! is_null($maxile) ? '#3BA9F4' : '#BF9237'); return ""; }; $chip = fn ($m) => is_null($m) ? "" : "M" . round($m) . ""; @endphp
@foreach ($fields as $field)
{!! $chip($field['user_maxile']) !!}
@foreach ($field['tracks'] as $track)
{!! $chip($track['user_maxile']) !!}
@foreach ($track['skills'] as $skill)
{!! $dot($skill['user_passed'], $skill['user_maxile']) !!} {{ $skill['name'] }} {!! $chip($skill['user_maxile']) !!}
@endforeach
@endforeach
@endforeach