@csrf

  --:-- Min

{{-- --}}
@php $test = isset($test) ? $test : null; if (isset($test->questions_data)) { $jsonData = json_decode($test->questions_data, true) ?? []; } @endphp @if (!empty($jsonData))
@foreach ($jsonData as $partKey => $part) @isset($part['bunch'])

PART {{ $loop->iteration }}

Listen and answer questions

@if (isset($part['paragraph']))

Audio

@endif @foreach ($part['bunch'] as $key => $bunch) @php $start = key($bunch['questions']); $end = array_key_last($bunch['questions']); @endphp

Questions: {{ @$bunch['visible_key'] }}

{!! @$bunch['heading'] !!}
{{-- --}} @foreach ($bunch['questions'] as $i => $questionData) @if (isset($questionData['count']) && !empty($questionData['count']))
@if ($questionData['type'] == 'dropdown')

{{ $i }} @php $html = "'; @endphp {!! str_replace('{answers}', $html, $questionData['ques']) !!} {{-- {!! $questionData['ques'] !!} --}} {{-- {!! $html !!} --}} @php // if (isset($questionData['answers']) && isset($questionData['option'])) { // $answers = $questionData['answers']; // $option = $questionData['option']; // foreach ($answers as $key) { // if (isset($option[$key])) { // echo ""; // } // } // } @endphp

@else

@if(strpos($bunch['visible_key'], '-') !== false) @if ($questionData['type'] == 'radio') {{ $i }} @else {{ $bunch['visible_key'] }} @endif @else {{ $bunch['visible_key'] }} @endif {!! $questionData['ques'] !!}

@if (isset($questionData['option']) && is_array($questionData['option'])) @if ($questionData['type'] == 'radio') @foreach ($questionData['option'] as $key => $option)
{{ $key }}
@endforeach {{-- @php if (isset($questionData['answers']) && isset($questionData['option'])) { $answers = $questionData['answers']; $option = $questionData['option']; foreach ($answers as $key) { if (isset($option[$key])) { echo ""; } } } @endphp --}} @elseif ($questionData['type'] == 'checkbox') @foreach ($questionData['option'] as $key => $option)
{{ $key }}
@endforeach {{-- @php if (isset($questionData['answers']) && isset($questionData['option'])) { $answers = $questionData['answers']; $option = $questionData['option']; foreach ($answers as $key) { if (isset($option[$key])) { echo ""; } } } @endphp --}} @else {{ 'Empty' }} @endif @endif
@endif
@elseif (isset($questionData['type']) && $questionData['type'] == 'input') {{-- --}}

{{ $i }} @php $html = " " @endphp {!! str_replace('{answers}', $html, $questionData['ques']) !!}

@elseif(isset($bunch['textarea']) && $bunch['textarea'] !== '')

@foreach ($bunch['questions'] as $key => $value) {{-- --}} @php $html = "{$key} "; $bunch['textarea'] = str_replace('{answers' . $key . '}', $html, $bunch['textarea']); @endphp @endforeach {!! $bunch['textarea'] !!}

{{-- Exit the loop --}} @php break; @endphp @endif @endforeach {{-- --}} @endforeach
@endisset @endforeach
@endif {{-- time up popup --}}