Manage exam record

{{-- form for selecting exam record to display --}}
@foreach ($exams as $item) @endforeach @foreach ($classes as $item) @endforeach @isset($subjects) @foreach ($subjects as $subject) @endforeach @endisset @isset($sections) @foreach ($sections as $item) @endforeach @endisset {{-- table for displaying exam records --}} @if(isset($examSlots) && isset($students) && $students != null)

{{$examSelected->name}} exam records

Exam: {{$examSelected->name}}

Class: {{$classSelected->name}}

Section: {{$sectionSelected->name}}

Subject: {{$subjectSelected->name}}

@foreach ($students as $student)

{{ $students->perPage() * ($students->currentPage() - 1) + $loop->iteration }}. {{$student->name}}

@foreach ($examSlots as $examSlot) @php $examRecord = $examRecords->where('user_id',$student->id)->where('subject_id', $subjectSelected->id)->where('exam_slot_id', $examSlot->id)->first(); $studentMarks = $examRecord ? $examRecord['student_marks'] : '0'; @endphp @can('update exam record') @else

{{$studentMarks}}

@endcan @endforeach @csrf @can('update exam record') @endcan
@endforeach {{$students->links('components.datatable-pagination-links-view')}}
@elseif ($error) Action could not be completed because {{$error}} @endif