@if (isset($grades[$course->coffid]))
@php
$home_titles = [];
$quiz_titles = [];
$full_home_data = [];
$full_quiz_data = [];
$hasItemsInCourse = false;
@endphp
@foreach ($grades[$course->coffid]['groups'] as $key => $group)
@php
$hasAssignments = false;
$hasQuizzes = false;
foreach ($grades[$course->coffid]['assignments_grades'] as $assignment) {
if ($group->gid == $assignment->gid) {
$hasAssignments = true;
break;
}
}
if (!$hasAssignments) {
foreach ($grades[$course->coffid]['hyper_assignments_grades'] as $assignment) {
if ($group->gid == $assignment->gid) {
$hasAssignments = true;
break;
}
}
}
foreach ($grades[$course->coffid]['quizzes_grades'] as $quiz) {
if ($group->gid == $quiz->gid) {
$hasQuizzes = true;
break;
}
}
if (!$hasQuizzes) {
foreach ($grades[$course->coffid]['hyper_quizzes_grades'] as $quiz) {
if ($group->gid == $quiz->gid) {
$hasQuizzes = true;
break;
}
}
}
$hasItemsInGroup = $hasAssignments || $hasQuizzes;
$hasItemsInCourse = $hasItemsInCourse || $hasItemsInGroup;
@endphp
@if ($hasItemsInGroup)
{{ $group->gname }}
@php
$home_label = [];
$home_data = [];
@endphp
@foreach ($grades[$course->coffid]['assignments_grades'] as $assignment)
@if ($group->gid == $assignment->gid)
@php
array_push($home_data, $assignment->ratio);
array_push($home_label, $assignment->title);
@endphp
@endif
@endforeach
@foreach ($grades[$course->coffid]['hyper_assignments_grades'] as $assignment)
@if ($group->gid == $assignment->gid)
@php
array_push($home_data, $assignment->ratio);
array_push($home_label, $assignment->title);
@endphp
@endif
@endforeach
@php
array_push($home_titles, $home_label);
array_push($full_home_data, $home_data);
@endphp
@foreach ($grades[$course->coffid]['topics'] as $topic)
@php
$quiz_label = [];
$quiz_data = [];
$hasQuizzesInTopic = false;
foreach ($grades[$course->coffid]['quizzes_grades'] as $quiz) {
if ($group->gid == $quiz->gid && $quiz->topic_id == $topic->id) {
$hasQuizzesInTopic = true;
break;
}
}
if (!$hasQuizzesInTopic) {
foreach ($grades[$course->coffid]['hyper_quizzes_grades'] as $quiz) {
if ($group->gid == $quiz->gid && $quiz->topic_id == $topic->id) {
$hasQuizzesInTopic = true;
break;
}
}
}
@endphp
@if ($hasQuizzesInTopic)
@foreach ($grades[$course->coffid]['quizzes_grades'] as $quiz)
@if ($group->gid == $quiz->gid && $quiz->topic_id == $topic->id)
@php
array_push($quiz_data, $quiz->ratio);
array_push($quiz_label, $quiz->title);
@endphp
@endif
@endforeach
@foreach ($grades[$course->coffid]['hyper_quizzes_grades'] as $quiz)
@if ($group->gid == $quiz->gid && $quiz->topic_id == $topic->id)
@php
array_push($quiz_data, $quiz->ratio);
array_push($quiz_label, $quiz->title);
@endphp
@endif
@endforeach
@if (count($quiz_label) > 0)
| Grade Item Title |
Grade |
Grade Ratio |
Start Date |
End Date |
Feedback |
Note |
@if ($grades[$course->coffid]['has_grade_schema'])
Expected Grade |
@endif
@foreach ($grades[$course->coffid]['quizzes_grades'] as $index => $item)
@if ($group->gid == $item->gid)
| {{ $item->title }} |
{{ $item->grade }} / {{ $item->points }} |
{{ round($item->ratio, 2) }}% |
{{ $item->attempt_start_date }} / {{ $item->attempt_start_time }} |
{{ $item->attempt_end_date }} / {{ $item->attempt_end_time }} |
{{ $item->feedback ? strip_tags($item->feedback) : 'No Feedback' }} |
{{ $item->note ? strip_tags($item->note) : 'No Note' }} |
@if ($grades[$course->coffid]['has_grade_schema'])
{{ $item->sign }} |
@endif
@endif
@endforeach
@foreach ($grades[$course->coffid]['hyper_quizzes_grades'] as $index => $item)
@if ($group->gid == $item->gid && $item->topic_id == $topic->id)
| {{ $item->title }} |
{{ $item->grade }} / {{ $item->points }} |
{{ round($item->ratio, 2) }}% |
{{ $item->attempt_start_date }} |
{{ $item->attempt_end_date }} |
{{ $item->feedback ? strip_tags($item->feedback) : 'No Feedback' }} |
{{ $item->note ? strip_tags($item->note) : 'No Note' }} |
@if ($grades[$course->coffid]['has_grade_schema'])
{{ $item->sign }} |
@endif
@endif
@endforeach
@endif
@endif
@endforeach
@endif
@endforeach
@if (!$hasItemsInCourse)
No grade items available for this course.
@endif
@else
No grades available for this course.
@endif