@extends('layouts.admin_lbb') @section('page-title', 'Leaderboard Ujian') @section('content')

Leaderboard - {{ $exam->name }}

{{ $exam->description ?? 'Tanpa deskripsi' }}

{{ $totalParticipants }} Peserta
{{ $totalParticipants }} Selesai
Passing Grade: {{ $exam->passing_grade }}
{{ $totalParticipants }}
Total Peserta
{{ $highestScore }}
Skor Tertinggi
{{ number_format($averageScore, 1) }}
Rata-rata Skor
{{ $passingCount }}
Siswa Lulus
@if($top3->count() >= 3)
{{-- 2nd Place Silver --}}
Peringkat 2
2

{{ $top3[1]->student->user->name ?? 'Tanpa Nama' }}

{{ $top3[1]->student->classModel->name ?? '-' }}

{{ number_format($top3[1]->highest_score, 1) }}
{{-- 1st Place Gold --}}
Juara 1
1

{{ $top3[0]->student->user->name ?? 'Tanpa Nama' }}

{{ $top3[0]->student->classModel->name ?? '-' }}

{{ number_format($top3[0]->highest_score, 1) }}
{{-- 3rd Place Bronze --}}
Peringkat 3
3

{{ $top3[2]->student->user->name ?? 'Tanpa Nama' }}

{{ $top3[2]->student->classModel->name ?? '-' }}

{{ number_format($top3[2]->highest_score, 1) }}
@endif
Peringkat Lengkap
@if(request('status')) @endif @if(request('per_page') && !in_array(request('per_page'), [10, 25, 50, 100])) @endif
{{ $participants->count() }} peserta
@php $currentRank = ($participants->currentPage() - 1) * $participants->perPage() + 1; @endphp @foreach($participants as $participant) @php $isPassed = $participant->highest_score >= $exam->passing_grade; $scoreColor = $isPassed ? 'text-success' : 'text-danger'; // Hitung durasi dari end_time - start_time $duration = null; if ($participant->end_time && $participant->start_time) { $diffSeconds = $participant->start_time->diffInSeconds($participant->end_time); $duration = floor($diffSeconds / 60) . 'm ' . ($diffSeconds % 60) . 's'; } @endphp @php $currentRank++; @endphp @endforeach
Rank Nama Kelas Tanggal Durasi Nilai Aksi
@if($currentRank <= 3) {{ $currentRank }} @else {{ $currentRank }} @endif
{{ $participant->student->user->name ?? 'Tanpa Nama' }}
{{ $participant->student->classModel->name ?? '-' }} @if($participant->created_at) {{ $participant->created_at->format('d M y') }} @else - @endif @if($duration) {{ $duration }} @else - @endif {{ number_format($participant->highest_score, 1) }}
@include('admin.modal.exam-leaderboard.detail') @endsection