@php $config = $this->getSubjectConfig(); $students = $this->getStudents(); $hasMcq = $config?->mcq_total !== null; $hasWritten = $config?->written_total !== null; $hasPractical = $config?->practical_total !== null; @endphp
{{-- Top Bar --}}
@if ($config) @if ($hasMcq) MCQ / {{ $config->mcq_total }} @endif @if ($hasWritten) Written / {{ $config->written_total }} @endif @if ($hasPractical) Practical / {{ $config->practical_total }} @endif Total: {{ $config->total_marks }} Pass: {{ $config->pass_mark }} @endif
@if ($students->isEmpty()) এই ক্লাসে কোনো active student নেই। @else {{-- Student Marks Table --}}
{{-- Header --}}
Students ({{ $students->count() }})
@if ($hasMcq) @endif @if ($hasWritten) @endif @if ($hasPractical) @endif @foreach ($students as $student) @php $studentMark = $marks[$student->id] ?? ['mcq_marks' => null, 'written_marks' => null, 'practical_marks' => null, 'is_absent' => false]; $isAbsent = (bool) ($studentMark['is_absent'] ?? false); $computedTotal = $isAbsent ? null : ((int) ($studentMark['mcq_marks'] ?? 0) + (int) ($studentMark['written_marks'] ?? 0) + (int) ($studentMark['practical_marks'] ?? 0)); @endphp @if ($hasMcq) @endif @if ($hasWritten) @endif @if ($hasPractical) @endif @endforeach
Roll Student MCQ / {{ $config->mcq_total }} Written / {{ $config->written_total }} Practical / {{ $config->practical_total }} Total Absent
{{ $student->roll_no }} {{ $student->user?->name ?? '—' }} @error('marks.'.$student->id.'.mcq_marks')

{{ $message }}

@enderror
@error('marks.'.$student->id.'.written_marks')

{{ $message }}

@enderror
@error('marks.'.$student->id.'.practical_marks')

{{ $message }}

@enderror
@if ($isAbsent) Absent @else {{ $computedTotal > 0 ? $computedTotal : '—' }} @endif
{{-- Save Footer --}}
@php $absentCount = collect($marks)->filter(fn ($m) => $m['is_absent'] ?? false)->count(); $presentCount = $students->count() - $absentCount; @endphp Present: {{ $presentCount }} Absent: {{ $absentCount }}
Save Marks Saving...
@endif