@php use App\Enums\AttendanceStatus; use App\Enums\AttemptStatus; $hasEssay = ($exam->total_essay ?? 0) > 0; @endphp {{-- Tabel Hasil Per Peserta --}}
Hasil Per Peserta

Nilai dan waktu pengerjaan ujian setiap peserta

@if ($exam->certificate_path) @endif @foreach ($participants as $i => $p) @php $isWithScore = (int) ($exam->with_score ?? 0) === 1; if ($isWithScore) { // Skema With Score (as sebelumnya) $statusLabel = match (true) { (bool) ($p->reschedule_id || $p->attendance_status == AttendanceStatus::RESCHEDULE->value) => 'Reschedule', $p->attempt_status == AttemptStatus::SUBMITTED->value => 'Submit', $p->attempt_status == AttemptStatus::ON_PROGRESS->value => 'On Progress', $p->attendance_status == AttendanceStatus::TIDAK_HADIR->value => 'Tidak Hadir', $p->attendance_status == AttendanceStatus::HADIR->value => 'Not Tested Yet', default => '-', }; } else { // Skema Without Score (Hadir / Tidak Hadir saja) $statusLabel = match (true) { (bool) ($p->reschedule_id || $p->attendance_status == AttendanceStatus::RESCHEDULE->value) => 'Reschedule', $p->attendance_status == AttendanceStatus::HADIR->value => 'Hadir', $p->attendance_status == AttendanceStatus::TIDAK_HADIR->value => 'Tidak Hadir', default => '-', }; } @endphp @if ($exam->certificate_path) @endif @endforeach
No Participant Name Department Attended Start Finish Duration Score Essay RescheduleCertificateDetail
{{ $i + 1 }}
{{ strtoupper(substr($p->name ?? $p->nik, 0, 1)) }}
{{ $p->name ?? $p->nik }}
{{ $p->nik }}
@if ($p->incoming_reschedule_id) Reschedule dari {{ $p->from_schedule_date ? \Carbon\Carbon::parse($p->from_schedule_date)->format('d/m/Y') : '-' }} @endif
{{ $p->department ?? '-' }} @if ($statusLabel == 'Reschedule') Reschedule @elseif ($statusLabel == 'Submit') Submit @elseif ($statusLabel == 'On Progress') On Progress @elseif ($statusLabel == 'Hadir') Hadir @elseif ($statusLabel == 'Tidak Hadir') Tidak Hadir @elseif ($statusLabel == 'Not Tested Yet') Not Tested Yet @else - @endif {{ $p->attempt_start ? \Carbon\Carbon::parse($p->attempt_start)->format('H:i') : '-' }} {{ $p->attempt_submit ? \Carbon\Carbon::parse($p->attempt_submit)->format('H:i') : '-' }} @if ($p->duration_seconds) {{ intdiv($p->duration_seconds, 60) }} Mnt {{ $p->duration_seconds % 60 }} Dtk @else - @endif @if ($p->total_score !== null) {{ number_format($p->total_score, 1) }} @else - @endif @if ($hasEssay) @if (!$p->attempt_id) - @elseif ($p->is_reviewed) @else Pending @endif @else - @endif @if ($p->reschedule_id || $p->attendance_status == AttendanceStatus::RESCHEDULE->value)
Ya @if ($p->to_schedule_date)
→ {{ \Carbon\Carbon::parse($p->to_schedule_date)->format('d/m/Y') }} @else
Tujuan tidak ditemukan @endif
@elseif ($p->attempt_status == AttemptStatus::SUBMITTED->value || $p->attempt_status == AttemptStatus::ON_PROGRESS->value) - @elseif ($isWithScore && ($p->attendance_status == AttendanceStatus::TIDAK_HADIR->value || $p->attendance_status == AttendanceStatus::HADIR->value)) {{-- With Score: Tidak hadir atau Not Tested Yet bisa reschedule --}} @elseif (!$isWithScore && $p->attendance_status == AttendanceStatus::TIDAK_HADIR->value) {{-- Without Score: Hanya yang Tidak Hadir bisa reschedule --}} @else - @endif
@if ($p->attempt_status == AttemptStatus::SUBMITTED->value && $p->attempt_id) Certificate @else - @endif @if ($p->attempt_status == AttemptStatus::SUBMITTED->value && $p->attempt_id) @else - @endif