Result Checker

@if (!auth()->user()->hasRole('student')) {{-- form for selecting class and section to display --}}
@isset($academicYears) @foreach ($academicYears as $item) @endforeach @endisset @isset($semesters) @foreach ($semesters as $item) @endforeach @endisset {{--fields are not available to any role not in list--}} @hasanyrole('super-admin|admin|teacher') @isset($classes) @foreach ($classes as $item) @endforeach @endisset @isset($sections) @foreach ($sections as $item) @endforeach @endisset @endhasanyrole @isset($students) @foreach ($students as $item) @endforeach @endisset
@endif @if ($preparedResults == true) @isset($exams)
@foreach ($exams as $exam) @endforeach @foreach ($subjects as $subject) @foreach ($exams as $exam) @endforeach @php $grade = app(App\Services\GradeSystem\GradeSystemService::class)->getGrade($selectedClass->classGroup->id, ( $examRecords->where('subject_id' , $subject->id)->pluck('student_marks')->sum()/$exams->pluck('totalAttainableMarksInASubject')->sum()) * 100) @endphp @endforeach
{{$exam->name}} ({{$exam->totalAttainableMarksInASubject}})Total ({{$exams->pluck('totalAttainableMarksInASubject')->sum()}}) Grade Remark
{{$subject->name}} {{$examRecords->whereIn('exam_slot_id', $exam->examSlots?->pluck('id'))->where('subject_id' , $subject->id)->pluck('student_marks')->sum()}} {{$examRecords->where('subject_id' , $subject->id)->pluck('student_marks')->sum()}} {{$grade->name ?? 'No Grade'}} {{$grade->remark ?? 'No Remark'}}
@foreach ($exams as $exam) @if (!$exam->examSlots->isEmpty())

{{$studentName}}'s result in {{$exam->name}}

@foreach ($exam->examSlots as $examSlot) @endforeach @foreach ($subjects as $subject) @foreach ($exam->examSlots as $examSlot) @endforeach @endforeach
Subject{{$examSlot->name}} ({{$examSlot->total_marks}})Total ({{$exam->examSlots->pluck('total_marks')->sum()}})
{{$subject->name}} {{$examRecords->where('subject_id' , $subject->id)->where('exam_slot_id' , $examSlot->id)->first()->student_marks ?? "No record"}} {{$examRecords->where('subject_id' , $subject->id)->whereIn('exam_slot_id', $exam->examSlots->pluck('id'))->sum('student_marks')}}

Total marks obtained: {{$examRecords->whereIn('exam_slot_id', $exam->examSlots->pluck('id'))->sum('student_marks')}} / {{$exam->examSlots->pluck('total_marks')->sum() * $subjects->count()}}

@endif @endforeach
@endisset @elseif (isset($status))

{{$status}}

@endif