@foreach ($print_section as $s)
@php
$answeredQuestions = $questions
->where('section_id', $s->id)
->filter(function ($print_question) use ($print_answers, $s) {
return $print_answers
->where('question_id', $print_question->id)
->where('section_id', $s->id)
// ->where('user_id', auth()->user()->id)
->isNotEmpty();
});
@endphp
Block - {{ $s->pillar->name }}
@foreach ($answeredQuestions as $q)
{{ $s->section_name }} - {{ $q->question_text }}
|
Nascent |
|
Stable
|
|
Maturing |
|
Efficient |
|
World
Class |
|
@php
$userAnswers = $print_answers
->where('question_id', $q->id)
->where('section_id', $s->id)
// ->where('user_id', auth()->user()->id);
@endphp
@foreach ($userAnswers as $userAnswer)
@if ($q->type == 'radio')
@foreach (json_decode($q->options) as $option)
|
{{ $option }}
|
|
@endforeach
@endif
@endforeach
@foreach ($userAnswers as $userAnswer)
|
@if ($q->type === 'text' || $q->type === 'textarea')
→
{{ $userAnswer->answer ?? 'No Answer' }}
@elseif ($q->type === 'radio')
{{ 'Current Level' }}
{{ 'After Three Years' }}
@endif
|
|
@endforeach
@endforeach
@endforeach
Assessment Comments:
{{ $comment ?? '' }}