@php
$submitted = collect($participants)->where('status', 'submitted');
$unstarted = collect($participants)->where('status', 'unstarted');
$totalSubmitted = $submitted->count();
$avgScore = $totalSubmitted > 0 ? $submitted->avg('total_score') : 0;
$passed = $submitted->where('total_score', '>=', 70)->count();
$passingRate = $totalSubmitted > 0 ? round(($passed / $totalSubmitted) * 100) : 0;
$fastest = $submitted->sortBy('raw_duration')->first();
$fastestTime = $fastest && $fastest->raw_duration > 0 ? intdiv($fastest->raw_duration, 60) . 'm' : '-';
$fastestName = $fastest ? $fastest->name : '-';
@endphp
Passing Rate (>=70)
{{ $passingRate }}%
{{ $passed }} passed
Average Score
{{ number_format($avgScore, 1) }}
From {{ $totalSubmitted }} submitted
Fastest Finish
{{ $fastestTime }}
Candidate: {{ Str::limit($fastestName, 10) }}
Total Missing
{{ $unstarted->count() }}
{{ $unstarted->count() }} Absent enrolled
| Candidate |
Final Score |
Status |
@foreach ($participants as $p)
|
{{ $p->name }}
|
{{ $p->status == 'submitted' ? number_format($p->total_score, 1) : '--' }}
|
@if ($p->status == 'submitted')
{{ $p->total_score >= 70 ? 'Passed' : 'Failed' }}
@else
-
@endif
|
@endforeach