@extends('admin.layouts.app') @php $categoryTitles = [ 1 => 'Listening', 2 => 'Speaking', 3 => 'Writing', 4 => 'Reading', ]; $title = isset($mockTest) && isset($categoryTitles[$mockTest->category_id]) ? 'Edit ' . $categoryTitles[$mockTest->category_id] : 'Create'; @endphp @section('title') {{ $title }} @endsection @section('content')
@php $route = isset($mockTest) ? route('mocktest.update', $mockTest->id) : route('mocktest.store'); @endphp
@csrf @if (isset($mockTest)) @method('PUT') @endif

Mock Test {!! isset($mockTest) ? "$title " . $mockTest->id . '' : 'Create' !!}

Back
@if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
{{-- Listening --}} @if ($mockTest->category_id == 1) @if (!empty($jsonData))
@if (!empty($jsonData)) @foreach ($jsonData as $partKey => $part) @isset($part['bunch'])
@php $range = '' @endphp {{ ucwords($partKey) }} ({{ $range }} Question)
{{-- hidden input for js --}} {{--

Please attach audio below:

@if (isset($part['paragraph']) && filter_var($part['paragraph'], FILTER_VALIDATE_URL)) @else @endif
@if (isset($part['paragraph'])) @endif
--}}
@if (isset($part['paragraph'])) @else placeholder @endif
@foreach ($part['bunch'] as $key => $bunch) @if (isset($bunch['questions'][0])) @php if (isset($bunch['merge'])) { $start = $bunch['questions'][0]; $end = $start; $mergekey = 1; } else { $start = $bunch['questions'][0]; $end = $bunch['questions'][1]; $mergekey = 0; } $visible_key = $bunch['questions'][0] . ' - ' . $bunch['questions'][1]; if ( $bunch['questions'][0] == $bunch['questions'][1] ) { $visible_key = $bunch['questions'][0]; } @endphp @else @php $start = key($bunch['questions']); $end = array_key_last( $bunch['questions'], ); @endphp @endif
@if (isset($bunch['textarea']))
@endif
@for ($i = $start; $i <= $end; $i++)
@if (!isset($bunch['textarea']))
{{-- --}}
@endif
@php $answerValue = isset( $bunch[ 'questions' ][$i][ 'answers' ], ) ? $bunch[ 'questions' ][$i]['answers'] : ''; @endphp
@if (isset($bunch['questions'][$i]['count']) && !empty($bunch['questions'][$i]['count'])) @php $answers = isset( $bunch[ 'questions' ][$i][ 'answers' ], ) ? $bunch[ 'questions' ][$i][ 'answers' ] : []; @endphp @for ($j = 1; $j <= $bunch['questions'][$i]['count']; $j++) @php $type = $bunch[ 'questions' ][ $i ][ 'type' ]; if ( $type == 'dropdown' ) { $type = 'radio'; } @endphp @endfor @endif
@endfor
@endforeach
@endisset @endforeach
Addition information
@endif
@else @php $part = ['1', '2', '3', '4']; @endphp @foreach ($part as $value) @endforeach
Paper Format for Reading
Part Bunch Question
Part {{ $value }}
@endif @endif {{-- Speaking --}} @if ($mockTest->category_id == 2) @if (!empty($jsonData))
@if (!empty($jsonData)) @foreach ($jsonData as $partKey => $part) @isset($part['bunch'])
{{ ucwords($partKey) }} Question
@foreach ($part['bunch'] as $key => $bunch) @if (isset($bunch['questions'][0])) @php $start = $bunch['questions'][0]; $end = $bunch['questions'][1]; @endphp @else @php $start = key($bunch['questions']); $end = array_key_last( $bunch['questions'], ); @endphp @endif
@for ($i = $start; $i <= $end; $i++)
{{-- @if (isset($bunch['questions'][$i]['video']) && !empty($bunch['questions'][$i]['video']))
@endif
--}}
@if (isset($bunch['questions'][$i]['video']) && !empty($bunch['questions'][$i]['video'])) @else placeholder @endif
@endfor
@endforeach
@endisset @endforeach
Addition information
@endif
@else @php $part = ['1', '2', '3']; @endphp @foreach ($part as $value) @endforeach
Paper Format for Speaking
Part Bunch Question
Part {{ $value }}
@endif @endif {{-- Writing --}} @if ($mockTest->category_id == 3)
Addition information
@endif {{-- Reading --}} @if ($mockTest->category_id == 4) @if (!empty($jsonData))
@if (!empty($jsonData)) @foreach ($jsonData as $partKey => $part) @isset($part['bunch'])
@php $range = '' @endphp {{ ucwords($partKey) }} ({{ $range }} Question)

Read the text below and answer questions {{ $range }}

@foreach ($part['bunch'] as $key => $bunch) @if (isset($bunch['questions'][0])) @php if (isset($bunch['merge'])) { $start = $bunch['questions'][0]; $end = $start; $mergekey = 1; } else { $start = $bunch['questions'][0]; $end = $bunch['questions'][1]; $mergekey = 0; } $visible_key = $bunch['questions'][0] . ' - ' . $bunch['questions'][1]; if ( $bunch['questions'][0] == $bunch['questions'][1] ) { $visible_key = $bunch['questions'][0]; } @endphp @else @php $start = key($bunch['questions']); $end = array_key_last( $bunch['questions'], ); @endphp @endif
@if (isset($bunch['textarea']))
@endif
@for ($i = $start; $i <= $end; $i++)
@if (!isset($bunch['textarea']))
{{-- --}}
@endif
@php $answerValue = isset( $bunch[ 'questions' ][$i][ 'answers' ], ) ? $bunch[ 'questions' ][$i]['answers'] : ''; @endphp
@if (isset($bunch['questions'][$i]['count']) && !empty($bunch['questions'][$i]['count'])) @php $answers = isset( $bunch[ 'questions' ][$i][ 'answers' ], ) ? $bunch[ 'questions' ][$i][ 'answers' ] : []; @endphp @for ($j = 1; $j <= $bunch['questions'][$i]['count']; $j++) @php $type = $bunch[ 'questions' ][ $i ][ 'type' ]; if ( $type == 'dropdown' ) { $type = 'radio'; } @endphp @endfor @endif
@endfor
@endforeach
@endisset @endforeach
Addition information
@endif
@else @php $part = ['1', '2', '3']; @endphp @foreach ($part as $value) @endforeach
Paper Format for Reading
Part Bunch Question
Part {{ $value }}
@endif @endif
@endsection @section('style') @include('map::links') @endsection @section('script') @endsection