@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))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
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