Statistics

@php $labels = []; @endphp @foreach ($quizzes_titles as $item) @php array_push($labels, $item->title); @endphp @endforeach @foreach ($assignments_titles as $item) @php array_push($labels, $item->title); @endphp @endforeach @foreach ($students as $student) {{-- {{ dd($student); }} --}} @php $graded = 0; $missed = 0; $ratio = 0; $data_quiz = []; $data_homework = []; @endphp @foreach ($quizzes_grades as $quiz) @if (in_array($student->id, $quiz->attempts_quiz->pluck('id')->toArray())) @php $flag = $quiz->attempts_quiz->where('id', $student->id)->first()->pivot->attempts_remainder; if ($flag == $quiz->attempts) { $missed += 1; array_push($data_quiz, ' '); } elseif ($flag < $quiz->attempts) { $graded += 1; $ratio += $quiz->attempts_quiz->where('id', $student->id)->first()->pivot->ratio; $temp = $quiz->attempts_quiz->where('id', $student->id)->first()->pivot->ratio; array_push($data_quiz, $temp); } array_push($data_homework, null); @endphp @endif @endforeach @foreach ($assignments_grades as $assignment) @if (in_array($student->id, $assignment->attempts_assignment->pluck('id')->toArray())) @php $flag = $assignment->attempts_assignment->where('id', $student->id)->first()->pivot->attempts_remainder; if ($flag == $assignment->attempts) { $missed += 1; array_push($data_homework, ' '); } elseif ($flag < $assignment->attempts) { $graded += 1; $ratio += $assignment->attempts_assignment->where('id', $student->id)->first()->pivot->ratio; $temp = $assignment->attempts_assignment->where('id', $student->id)->first()->pivot->ratio; array_push($data_homework, $temp); } array_push($data_quiz, null); @endphp @endif @endforeach @endforeach
# Student Total Graded Missed Persantage Progress
{{ ++$count }} {{ $student->first_name }} {{ $student->middle_name }} {{ $student->last_name }} {{ count($quizzes_grades) + count($assignments_grades) }} {{ $graded }} {{ $missed }} {{ $graded != 0 ? round($ratio / $graded, 2) : 0 }}%
{{-- begin:pagination --}}
{{ $students->appends(Request::except('page'))->render('components._pagination') }}

Displaying {{ $students->count() }} of {{ $students->total() }} student(s).

{{-- end:pagination --}}