@extends('mock-test.layouts.ielts-mock-test') @section('main') @php function checkResult($results, $testId) { foreach ($results as $result) { if ($result['test_id'] == $testId && $result['status'] != 1) { return false; } } return true; } @endphp

IELTS Mock Test

@if(!empty($ieltsTests)) @php $firstTestStatus = 'submitted'; @endphp
@foreach ($ieltsTests as $key => $test)
IELTS Test {{ ++$key }}
@if( in_array($test->listening_test_id, array_column($results, 'test_id')) && in_array($test->writing_test_id, array_column($results, 'test_id')) && // in_array($test->speaking_test_id, array_column($results, 'test_id')) && in_array($test->reading_test_id, array_column($results, 'test_id')) ) @if( in_array($test->speaking_test_id, array_column($results, 'test_id')) && checkResult($results, $test->listening_test_id) && checkResult($results, $test->writing_test_id) && checkResult($results, $test->reading_test_id) && checkResult($results, $test->speaking_test_id) )
Submitted
View Result @else
Submitted
Result Pending @endif @php $firstTestStatus = 'submitted'; @endphp @else @if ($firstTestStatus === 'submitted')
Unlocked
Start Test @php $firstTestStatus = 'unlocked'; @endphp @else
Locked
Unlock Test @endif @endif
@endforeach
@else

No Test Found

@endif @endsection @section('css') @endsection @section('script') @endsection