@php $format = isset($format) ? $format : "3-point"; $termResult = isset($termResult) ? $termResult : []; $coScholastic = isset($termResult['coScholastic']) ? $termResult['coScholastic'] : []; // Helper to get co-scholastic grade by key // Supports both new keys (work_education) and legacy keys (Wor) $getGrade = function($key, $legacyKey = null, $defaultGrade = 'C') use ($coScholastic, $format) { // Try new key first if (isset($coScholastic[$key]['grade'])) { return $coScholastic[$key]['grade']; } // Try legacy key if ($legacyKey && isset($coScholastic[$legacyKey]['grade'])) { return $coScholastic[$legacyKey]['grade']; } // Return default based on format return $format === '3-point' ? 'C' : 'E'; }; @endphp @if($format=="3-point")
| Co-Scholastic Areas Term {{ $term }} | ||||
|---|---|---|---|---|
| Work Education | Art Education | Health and Physical Education | Discipline | |
| {{ $getGrade('work_education', 'Wor') }} | {{ $getGrade('art_education', 'Art') }} | {{ $getGrade('health_physical_education', 'Hea') }} | {{ $getGrade('discipline', 'Dis') }} | |
| On a 5-point Grading Scale | |
|---|---|
| PART - II Co-Scholastic Areas: | GRADE |
| Work Education | {{ $getGrade('work_education', 'Wor', 'E') }} |
| Art Education | {{ $getGrade('art_education', 'Art', 'E') }} |
| Health and Physical Education | {{ $getGrade('health_physical_education', 'Hea', 'E') }} |
| Discipline | {{ $getGrade('discipline', 'Dis', 'E') }} |
| On a 9-point Grading Scale | |
|---|---|
| PART - II Co-Scholastic Areas: | GRADE |
| Work Education | {{ $getGrade('work_education', 'Wor', 'E') }} |
| Art Education | {{ $getGrade('art_education', 'Art', 'E') }} |
| Health and Physical Education | {{ $getGrade('health_physical_education', 'Hea', 'E') }} |
| Discipline | {{ $getGrade('discipline', 'Dis', 'E') }} |