@extends('components.app-layout') @section('title', 'Student Dashboard - SPETA Exam Hub') @section('content')

Hello, {{ auth()->user()->first_name }}!

Here's what's happening with your exams

@php $studentStats = [ ['label' => 'Available', 'value' => $availableExams->count(), 'color' => 'primary', 'icon' => 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4'], ['label' => 'Upcoming', 'value' => $upcomingExams->count(), 'color' => 'amber', 'icon' => 'M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'], ['label' => 'Completed', 'value' => $completedExams, 'color' => 'emerald', 'icon' => 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'], ['label' => 'Avg Score', 'value' => round($averageScore, 1) . '%', 'color' => 'violet', 'icon' => 'M13 7h8m0 0v8m0-8l-8 8-4-4-6 6'], ]; @endphp @foreach($studentStats as $stat)

{{ $stat['value'] }}

{{ $stat['label'] }}

@endforeach

Available Exams

View All
@forelse($availableExams as $exam)

{{ $exam->title }}

{{ $exam->course->title }} · {{ $exam->type_label }} · {{ $exam->duration_minutes }} min · {{ $exam->question_count }} questions

@if($exam->end_time)

Closes {{ $exam->end_time->diffForHumans() }}

@endif
Start
@empty
No available exams right now
@endforelse
@if($upcomingExams->count() > 0)

Upcoming Exams

@foreach($upcomingExams as $exam)

{{ $exam->title }}

{{ $exam->course->title }} · Starts {{ $exam->start_time->format('M d, Y H:i') }}

{{ $exam->start_time->diffForHumans() }}
@endforeach
@endif

Performance

@if($performanceData->count() > 0) @else
No data yet
@endif

Recent Results

@forelse($recentResults as $result)

{{ $result->exam->title }}

{{ $result->created_at->diffForHumans() }}

{{ $result->percentage }}%
@empty
No results yet
@endforelse
@push('scripts') @if($performanceData->count() > 0) @endif @endpush @endsection