@php /** @var \App\Models\User $user */ $user = $this->record; $score = $this->getCurrentScore(); $trajectory = $this->getTrajectory(); $byPos = $this->getStrengthsByPos(); $bySkill = $this->getStrengthsBySkill(); $byBloom = $this->getStrengthsByBloom(); $mastered = $this->getWordsMastered(); $struggled = $this->getWordsStruggled(); $eng = $this->getEngagement(); $classes = $this->getClassrooms(); // pretty colour ramp for success-rate bars: red → amber → green $pctColor = function ($pct) { if ($pct === null) return '#9CA3AF'; if ($pct >= 80) return '#16A34A'; if ($pct >= 60) return '#84CC16'; if ($pct >= 40) return '#CA8A04'; return '#C9302C'; }; @endphp {{-- Header strip --}}
{{ strtoupper(substr($user->name ?? '?', 0, 1)) }}
{{ $user->name }}
{{ $user->email ?? $user->phone }}
@if (count($classes) > 0)
@foreach ($classes as $c) {{ $c['name'] }} · {{ strtoupper($c['role']) }} @endforeach
@endif
{{ $score?->vocabile_score ?? '—' }}
Vocabile {{ $score?->level_code ? '· '.$score->level_code : '' }}
{{-- Engagement strip --}}
@php $stats = [ ['label' => 'Sessions (7d)', 'value' => $eng['sessions_7d']], ['label' => 'Sessions (30d)', 'value' => $eng['sessions_30d']], ['label' => 'Kudos (7d)', 'value' => '+'.$eng['kudos_7d']], ['label' => 'Lives', 'value' => $eng['is_unlimited'] ? '∞' : $eng['current_lives']], ]; @endphp @foreach ($stats as $s)
{{ $s['value'] }}
{{ $s['label'] }}
@endforeach
{{-- Trajectory --}}
Vocabile Trajectory
@if (empty($trajectory))
No completed assessments yet.
@else
@foreach ($trajectory as $t) @php $h = $t['score'] !== null ? min(80, max(8, ($t['score'] / 1500) * 80)) : 8; @endphp
{{ $t['score'] ?? '—' }}
{{ $t['at']->format('M d') }}
@endforeach
@endif
{{-- Strengths / weaknesses --}}
@foreach ([ ['title' => 'By Part of Speech', 'rows' => $byPos], ['title' => 'By Skill', 'rows' => $bySkill], ['title' => 'By Bloom level', 'rows' => $byBloom], ] as $panel)
{{ $panel['title'] }}
@if (empty($panel['rows']))
No data yet
@else @foreach ($panel['rows'] as $r)
{{ $r['name'] }} {{ $r['pct'] }}%
{{ $r['attempts'] }} attempts
@endforeach @endif
@endforeach
{{-- Words mastered / struggled --}}
✓ Words mastered
@if (empty($mastered))
No mastered words yet — need 2+ correct attempts.
@else @foreach ($mastered as $w)
{{ $w['lemma'] }}
@if ($w['definition'])
{{ $w['definition'] }}
@endif
{{ $w['correct'] }}/{{ $w['attempts'] }}
@endforeach @endif
⚠ Needs work
@if (empty($struggled))
No struggle points yet — keep practising!
@else @foreach ($struggled as $w)
{{ $w['lemma'] }}
@if ($w['definition'])
{{ $w['definition'] }}
@endif
{{ $w['correct'] }}/{{ $w['attempts'] }}
@endforeach @endif