@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 + $subjectWiseQuestion[$tqr_key][$item["subject_id"]]["correct_answer"]; $total_wrong_answers = $total_wrong_answers + $subjectWiseQuestion[$tqr_key][$item["subject_id"]]["wrong_answer"]; $total_not_answered = $total_not_answered + $subjectWiseQuestion[$tqr_key][$item["subject_id"]]["not_answer"]; @endphp @endforeach
Subject Correct Answers Wrong Answers Not Answered
{{$subjects[$item['subject_id']] ?? 'None'}} {{$subjectWiseQuestion[$tqr_key][$item["subject_id"]]["correct_answer"] ?? null}} {{$subjectWiseQuestion[$tqr_key][$item["subject_id"]]["wrong_answer"] ?? null}} {{$subjectWiseQuestion[$tqr_key][$item["subject_id"]]["not_answer"] ?? 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