@extends('layout.app', ['title' => 'Kết quả kiểm tra']) @push('style') @vite(['resources/css/landing.css', 'resources/css/level-test.css']) @endpush @php use App\Enums\QuestionLabelEnum; function getLabelClass($label, $answer, $correct) { if ($label === $correct && $correct === $answer) { return 'answered-correct'; // cau tra loi dung voi dap an va dung voi label } if ($label === $correct && $answer !== $correct) { return 'answer-correct'; // cau tra loi dung khong dung voi dap an va nhung dung voi label } if ($label === $answer && $answer !== $correct) { return 'answer-wrong'; // cau tra loi sai voi dap an va sai voi label } return ''; } // get so checkbox de hien thi dua vao truong choices // $answerLabel=["A","B","C",...] function getAnswerLabels($choices): array { $choicesArray = $choices ? json_decode($choices, true) : ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']; return QuestionLabelEnum::getAnswerLabels(count($choicesArray)); } function evaluateRating($percentCorrectAnswers) { if ($percentCorrectAnswers >= 90) { return 'A'; } elseif ($percentCorrectAnswers >= 80) { return 'B'; } elseif ($percentCorrectAnswers >= 70) { return 'C'; } elseif ($percentCorrectAnswers >= 60) { return 'D'; } else { return 'F'; } } function evaluateLevel($percentCorrectAnswers) { if ($percentCorrectAnswers >= 60) { return 'Đạt'; } else { return 'Không Đạt'; } } $descriptions = [ 'Đặt ra mục tiêu, đam mê, và không ngừng nỗ lực - thành công sẽ là thành tựu của những ai kiên trì và không bao giờ từ bỏ.', 'Những nỗ lực hôm nay sẽ thắp sáng con đường tương lai của bạn. Hãy tin tưởng vào bản thân và tiến lên với mục tiêu rực rỡ!', 'Hãy kiên trì và nỗ lực, thành công sẽ đến với những ai không ngừng cố gắng.', 'Chăm chỉ hôm nay, thành công ngày mai – bạn đang trên đường chinh phục ước mơ!', ]; $randomDescription = $descriptions[array_rand($descriptions)]; @endphp @section('content')
@include('layout.landing_banner', [ 'title' => $title, 'description' => $randomDescription, ])
@if ($myScore['levelStar'] == 0) @else @endif

{{ $selectedParam[0]['type'] == 0 ? evaluateRating($myScore['percentageScore']) : evaluateLevel($myScore['percentageScore']) }}

{{ $myScore['correctAnswers'] }} / {{ $myScore['totalQuestions'] }}

Về Trang Chủ @if ($selectedParam[0]['type'] == 0) Kiểm Tra Thêm @else Kiểm Tra Thêm @endif
@foreach ($questions as $index => $question)
Câu {{ ($questions->currentPage() - 1) * $questions->perPage() + $loop->iteration }}:
{{-- Show ra cac cau hoi --}}
@if ($question['result']) {{-- Truong hop tra loi trac nghiem A,B,C,D --}}
@foreach (getAnswerLabels($question['choices']) as $label)
@endforeach
@if ($question['answer_text'])

Giải thích:

@endif @else {{-- Truong hop tra loi cau hoi tu luan --}}
@if ($question['answerData']['is_true'] !== null) @endif
@if ($question['answerData']['is_true'] == 1) @endif @if ($question['answerData']['is_true'] == 0 && $question['answerData']['is_true'] !== null) @endif
@endif
@endforeach {{-- Pagination --}}
{{ $questions->links('tutors.pagination-request-manager') }}
@include('landing.level_tests.show_notice_timeout_no_answer', [ 'noAnswerDataFlag' => $noAnswerDataFlag, ])
@endsection @push('script') @vite(['resources/js/question_mathpix.js', 'resources/js/question_mathpix_image_responsive.js', 'resources/js/more_question_level_test.js']) @endpush