@php $tenant = \App\Support\Facades\Tenancy::get(); $brandStyle = $tenant->brand_primary_color ? ":root { --color-brand-600: {$tenant->brand_primary_color}; } .dark { --color-brand-600: {$tenant->brand_primary_color}; }" : null; $statusColors = ['draft' => 'slate', 'scheduled' => 'amber', 'results_published' => 'green']; $fmt = fn ($n) => $n === null ? '—' : rtrim(rtrim(number_format((float) $n, 2), '0'), '.'); $courses = \App\Models\Course::where('status', 'active')->orWhere('id', $test->course_id)->orderBy('name')->get(); $batchNames = $test->batches->pluck('name', 'id'); @endphp
@if($test->isOnline() && ! $test->resultsPublished()) Questions ({{ $test->testQuestions->count() }}) @endif @if($test->status === 'draft')
@csrf
@endif
@include('tenant.coaching._errors')

Status

{{ $test->statusLabel() }}

Total marks

{{ $fmt($test->total_marks) }}

{{ $test->pass_marks !== null ? 'Pass '.$fmt($test->pass_marks) : 'No pass mark' }}

Appeared

{{ $stats['appeared'] }} / {{ count($roster) }}

Highest / Avg

{{ $fmt($stats['highest']) }} / {{ $fmt($stats['average']) }}

{{ $test->isOnline() ? 'Online' : 'Passed' }}

@if($test->isOnline())

{{ $test->duration_minutes }} min · −{{ $fmt($test->negative_marks) }}/wrong

{{ $test->opens_at?->format('d M g:i A') ?? 'Opens when scheduled' }}{{ $test->closes_at ? ' → '.$test->closes_at->format('d M g:i A') : '' }}

@else

{{ $stats['passed'] ?? '—' }}

@endif
@if($test->isOnline())
@forelse($roster as $studentId => $batchId) @php $student = $students->get($studentId); $result = $results->get($studentId); @endphp @continue(! $student) @empty @endforelse
StudentBatchStatusCorrect / Wrong / SkippedMarks
{{ $student->first_name }} {{ $student->last_name }} {{ $student->student_code }} {{ $batchNames[$batchId] ?? '—' }} @if($result?->submitted_at)Submitted {{ $result->submitted_at->format('g:i A') }} @elseif($result?->started_at)In progress @elseNot started@endif {{ $result?->submitted_at ? $result->correct_count.' / '.$result->wrong_count.' / '.$result->skipped_count : '—' }} {{ $result?->submitted_at ? $fmt($result->marks) : '—' }}
No students in the selected batches.
@else
@csrf

Header row + one row per student, matched by student ID or roll. @if($test->answer_key) Answers as one column (id,answers → STU-001,BCAD-A) or q1…q{{ count($test->answerKeyLetters()) }} columns; “-” = blank, “*” = double-filled (wrong). @else Add an answer key to the test to grade answers, or upload id,marks. @endif

@if(session('omr_errors'))
    @foreach(session('omr_errors') as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf @forelse($students as $student) @php $result = $results->get($student->id); @endphp @empty @endforelse
#StudentBatchAbsentMarks (out of {{ $fmt($test->total_marks) }})
{{ $loop->iteration }} {{ $student->first_name }} {{ $student->last_name }} {{ $student->student_code }} {{ $batchNames[$roster[$student->id]] ?? '—' }}
No students in the selected batches.
@if($students->isNotEmpty())
@endif
@endif

Merit list

@if($merit->isEmpty())

Publish results to rank students.

@else @foreach($merit as $result) @endforeach
PositionStudentBatchMarks%
{{ $result->merit_position }} {{ $result->student?->first_name }} {{ $result->student?->last_name }} {{ $result->student?->student_code }} {{ $result->batch?->name ?? '—' }} {{ $fmt($result->marks) }} {{ $result->setRelation('test', $test)->percent() }}% Progress
@endif
@include('tenant.coaching.tests._form', ['test' => $test]) @if($results->isEmpty())
@csrf @method('DELETE')
@endif
@csrf

Ranks everyone who sat the test{{ $test->isOnline() ? ' (unfinished attempts are submitted with what they saved)' : '' }} and shows results in the student panel.