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

Hello {{ auth()->user()->name }}!

@if (!empty($ieltsTests)) Complete these {{ count($ieltsTests) }} Mock tests and assess your progress! @endif @if (!empty($ieltsTests))
/{{ count($ieltsTests) }}
@endif
goal
@if (!empty($ieltsTests))
@php $firstTestStatus = 'submitted'; @endphp @foreach ($ieltsTests as $key => $test) @if ($test->id >= 130) @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))

Mock Test

@php $totalScore = 0; $totalTests = 4; @$score = 0; foreach ($results as $result) { if ($result['test_id'] == @$test->listening_test_id) { $score = $score + $result['band']; } elseif ($result['test_id'] == @$test->writing_test_id) { $score = $score + $result['band']; } elseif ($result['test_id'] == @$test->reading_test_id) { $score = $score + $result['band']; } elseif ($result['test_id'] == @$test->speaking_test_id) { $score = $score + $result['band']; } } $averageBand = round(($score / $totalTests) * 2) / 2; // $averageBand = round($score / $totalTests, 2); @endphp

{{ $averageBand }} Bands

arrow-right
@endif @php $firstTestStatus = 'submitted'; @endphp @else @if ($firstTestStatus === 'submitted')
{{ $loop->iteration }} Mock Test {{-- Mock Test --}} {{--

20 Questions

--}}
play
@php $firstTestStatus = 'unlocked'; @endphp @else
{{ $loop->iteration }} Mock Test {{--

20 Questions

--}}
lock
@endif @endif @else @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))

Mock Test

@php $totalScore = 0; $totalTests = 4; @$score = 0; foreach ($results as $result) { if ($result['test_id'] == @$test->listening_test_id) { $score = $score + $result['band']; } elseif ($result['test_id'] == @$test->writing_test_id) { $score = $score + $result['band']; } elseif ($result['test_id'] == @$test->reading_test_id) { $score = $score + $result['band']; } elseif ($result['test_id'] == @$test->speaking_test_id) { $score = $score + $result['band']; } } $averageBand = round(($score / $totalTests) * 2) / 2; // $averageBand = round($score / $totalTests, 2); @endphp

{{ $averageBand }} Bands

arrow-right
@endif @else
{{ $loop->iteration }} Mock Test
play
@endif @endif @endforeach
@endif
@endsection @section('css') @endsection @section('script') @if (!empty($ieltsTests)) @endif @endsection