@csrf

  --:-- Min

{{-- --}}
{{-- Instruction Section as popup on whole screen --}} @php $test = isset($test) ? $test : null; if (isset($test->questions_data)) { $jsonData = json_decode($test->questions_data, true) ?? []; } // dd($test); @endphp {{-- Reading Question Paper --}} @if (!empty($jsonData))
@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) @if (isset($part['bunch']) && is_array($part['bunch']))

PART {{ $loop->iteration }}

Read the text below and answer questions

{!! @$part['paragraph'] !!}
@foreach ($part['bunch'] as $key => $bunch) @php // dd($jsonData); $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

@elseif ($questionData['type'] == 'radio')

{{ $i }} {!! $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 --}} @elseif($questionData['type'] == 'input')

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

@elseif($questionData['type'] == 'dropdown')

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

@else {{ 'Empty' }} @endif @endif
@else

{{ $i }} {!! $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
@endif @endforeach
@endif
@endif {{-- time up popup --}}