@php
$anyData = false;
@endphp
@foreach($progressData['behaviorChecklist'] as $outcome)
@php
// Filter behaviors that have stats
$behaviorsWithStats = collect($outcome['behaviors'])->filter(function($behavior) use ($progressData) {
$stats = collect($progressData['behaviorStats'])->firstWhere('title', $behavior['title']);
return $stats && ($stats['already_excellent'] > 0 || $stats['needs_improvement'] > 0);
});
@endphp
@if($behaviorsWithStats->isNotEmpty())
@php
$anyData = true;
@endphp
{{-- Learning Outcome Header --}}
Level {{ $outcome['level'] }}
{{ $outcome['title'] }}
{{-- Behaviors Table --}}
|
Observable Behavior
|
Excellent
|
Needs Improvement
|
Total
|
@foreach($outcome['behaviors'] as $behavior)
@php
$behaviorStats = collect($progressData['behaviorStats'])->firstWhere('title', $behavior['title']);
@endphp
@if($behaviorStats && ($behaviorStats['already_excellent'] > 0 || $behaviorStats['needs_improvement'] > 0))
|
{{ $behavior['title'] }}
|
{{ $behaviorStats['already_excellent'] }}
|
{{ $behaviorStats['needs_improvement'] }}
|
{{ $behaviorStats['already_excellent'] + $behaviorStats['needs_improvement'] }}
|
@endif
@endforeach
@endif
@endforeach
@if(!$anyData)
@lang('app.No behavior data available')
@endif