@if(!empty($value->subject_analysis)) @php $elm = json_decode($value->subject_analysis,true); $elm = is_array($elm) ? $elm : []; @endphp @if (count($elm) > 0) @php $total_correct_answers = 0; $total_wrong_answers = 0; $total_not_answered = 0; @endphp @foreach ($elm as $item) @php $total_correct_answers = $total_correct_answers + ($item['correct_answers'] ?? 0); $total_wrong_answers = $total_wrong_answers + ($item['wrong_answers'] ?? 0); $total_not_answered = $total_not_answered + ($item['not_answered'] ?? 0); @endphp @endforeach
Subject Correct Answers Wrong Answers Not Answered
{{$subjects[$item['subject_id']] ?? 'None'}} {{$item['correct_answers'] ?? null}} {{$item['wrong_answers'] ?? null}} {{$item['not_answered'] ?? null}}
Total {{$total_correct_answers}} {{$total_wrong_answers}} {{$total_not_answered}}
@endif @if ((isset($test) && $test->isEssay()) || (!empty($value->score_essay)) && $value->score_essay != "[]" ) @php $score_essays = json_decode($value->score_essay ?? null, true); $score_essays = is_array($score_essays) ? $score_essays : []; $total_score_essay = 0; if (count($score_essays) > 0) { $total_score_essay = array_sum(array_column($score_essays, 'marks_percent_bandScore')); } @endphp

Essay Marks : {{ceil($total_score_essay ?? 0)}}

@endif @endif