Progress Review

*

Learner’s Name: {{$seniorGradeReport['seniorGradeReport']->student->name}}

Attendance: {{$seniorGradeReport['totalDaysPresent']}} Out Of {{$seniorGradeReport['totalWorkingDays']}}

{{$seniorGradeReport['ageString']}}

Grade: {{$seniorGradeReport['student']->classSection->name}}

Date: {{$seniorGradeReport['currentDate']}}

Term: 2

@php use Illuminate\Support\Str; if (!function_exists('isUrdu')) { function isUrdu($text) { return preg_match('/[\x{0600}-\x{06FF}]/u', $text); } } if (!function_exists('getChunks')) { function getChunks($array, $chunkSize) { return array_chunk($array, $chunkSize); } } if (!function_exists('getProgressBySubject')) { function getProgressBySubject($progressData, $subjectId) { return collect($progressData)->firstWhere('subject_id', $subjectId); } } @endphp @foreach(getChunks($seniorGradeReport['classSubjects'], 3) as $chunk)
@foreach($chunk as $subject) @php $progress = getProgressBySubject($seniorGradeReport['progressData'], $subject['subject_id']); $strands = $progress['strands'] ?? []; $marks = $progress['marks'] ?? []; $remarks = $progress['remarks'] ?? null; // Check if any Urdu content is present $isUrduContent = isUrdu($subject['subject_name']) || collect($strands)->pluck('strand')->filter(fn($s) => isUrdu($s))->isNotEmpty() || isUrdu($remarks); @endphp
@if(count($strands) > 0) @for($i = 1; $i <= 4; $i++) @endfor @foreach($strands as $strand) @for($i = 1; $i <= 4; $i++) @endfor @endforeach @else @endif
{{ $subject['subject_name'] }} {{ implode(' & ', $subject['teachers']) }} {{ $i }}
{{ $strand['strand'] }} @if($strand['chosen_number'] == $i) {{$i}} @endif
{{ $subject['subject_name'] }} {{ implode(' & ', $subject['teachers']) }}
@if(!empty($marks)) @foreach($marks as $mark) @endforeach @php $totalN = 0; $totalD = 0; @endphp @foreach($marks as $mark) @php $totalN += $mark['nenominator']; $totalD += $mark['denominator']; @endphp @endforeach
Marks{{ $mark['name'] }}Total
Scored Total{{ $mark['nenominator'] }} {{ $mark['denominator'] }}{{ $totalD > 0 ? number_format(($totalN / $totalD) * 100, 2) : '0.00' }} %
@endif @if(!empty($remarks))

Comments

{{ $remarks }}

@endif
@endforeach @if($loop->last && !empty(trim($seniorGradeReport['commentValue'] ?? '')))

Comments

{{ $seniorGradeReport['commentValue'] }}

@endif @if($loop->last)
*
@endif
@endforeach