@push('style') @vite(['resources/css/landing.css', 'resources/css/level-test.css', 'resources/css/unit/unit_exercise.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)); } @endphp

Số điểm bạn đạt được

{{ $myScore }} / {{ $questions->total() }}

@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)
@foreach ([0, 25, 50, 75, 100] as $value) @endforeach
@endif
@endif
@endforeach {{-- Pagination --}}
{{ $questions->links('tutors.pagination-request-manager') }}
@include('landing.level_tests.show_notice_timeout_no_answer', [ 'noAnswerDataFlag' => $noAnswerDataFlag, ]) @push('script') @vite(['resources/js/question_mathpix.js', 'resources/js/question_mathpix_image_responsive.js']) @endpush