@php $user = auth()->user(); $avgDisplay = ($completedExams == 0 || !$averageScore) ? null : number_format($averageScore, 1); $profilePhoto = $user->profilePhotoUrl() ?? asset('images/default-male.png'); $hour = (int) now()->format('H'); $greeting = $hour < 12 ? 'Good morning' : ($hour < 17 ? 'Good afternoon' : 'Good evening'); @endphp
{{-- ============ WELCOME HERO ============ --}}
{{ $user->name }}

{{ $greeting }} ๐Ÿ‘‹

{{ $user->name }}

{{ $user->registration_no ?? 'Student' }} @if($user->semester) ยท {{ $user->semester }} @endif

{{-- ============ STATS GRID ============ --}}

Tests Taken

0

Avg Score

@if($avgDisplay)

0%

@else

โ€”

@endif

Live Now

0

Weak Areas

0

{{-- ============ LIVE EXAMS ============ --}} @if($liveExams->count())

Live Now

Tests you can attempt right now

View All โ†’
@endif {{-- ============ SUBJECT PERFORMANCE ============ --}} @if(count($subjectPerformance) > 0)

Subject Performance

Your strong and weak areas

Full Analysis โ†’
@foreach(array_slice($subjectPerformance, 0, 6) as $subject) @php $statusMap = [ 'strong' => ['color' => 'green', 'icon' => 'โœ“', 'label' => 'Strong'], 'average' => ['color' => 'yellow', 'icon' => '~', 'label' => 'Average'], 'weak' => ['color' => 'red', 'icon' => '!', 'label' => 'Weak'], ]; $s = $statusMap[$subject['status']] ?? $statusMap['average']; @endphp
{{ $s['icon'] }}
{{ $subject['subject'] }} {{ $subject['percentage'] }}%
{{ $subject['attempts'] }} attempt{{ $subject['attempts'] > 1 ? 's' : '' }}
@endforeach
@endif {{-- ============ WEAK AREAS ============ --}} @if(count($weakSubjects) > 0)

Focus Areas

These subjects need extra attention

@foreach($weakSubjects as $weak)

{{ $weak['subject'] }}

{{ $weak['exam_type'] }}

{{ $weak['percentage'] }}% {{ $weak['attempts'] }} test{{ $weak['attempts'] > 1 ? 's' : '' }}
@endforeach
See detailed weak topic analysis
@endif {{-- ============ RECENT + LEADERBOARD ============ --}}
{{-- RECENT ATTEMPTS --}}

Recent Attempts

Your latest test results

All โ†’
@forelse($recentAttempts as $attempt) @php $scoreColor = $attempt->percentage >= 60 ? 'green' : ($attempt->percentage >= 40 ? 'yellow' : 'red'); $passed = $attempt->status === 'Pass'; @endphp

{{ $attempt->exam->title ?? 'Test' }}

{{ $attempt->exam->subject ?? '' }} ยท {{ $attempt->created_at->diffForHumans() }}

{{ number_format($attempt->percentage, 1) }}%

{{ $attempt->status }}

@empty @endforelse
{{-- LEADERBOARD --}}

Top Performers

Compete with the best

@forelse($topStudents as $index => $row) @php $isMe = $row->user_id === $user->id; $rank = $index + 1; $medal = $rank === 1 ? '๐Ÿฅ‡' : ($rank === 2 ? '๐Ÿฅˆ' : ($rank === 3 ? '๐Ÿฅ‰' : $rank)); @endphp
{{ $medal }} {{ $row->user->name }}

{{ $row->user->name }} @if($isMe)(You)@endif

{{ $row->attempts }} tests

{{ number_format($row->avg_percentage, 1) }}%
@empty

No data yet

@endforelse
{{-- ============ UPCOMING EXAMS ============ --}} @if($nextExams->count())

Upcoming Tests

Scheduled exams to prepare for

View All โ†’
@foreach($nextExams as $exam)
{{ $exam->exam_type }} @if($exam->difficulty_level) {{ $exam->difficulty_level }} @endif

{{ $exam->title }}

@if($exam->subject && $exam->subject !== 'All Subjects')
{{ $exam->subject }}
@endif
@endforeach
@endif