From 9ecd947d8f37792d2416b662a9023b3ed8930b17 Mon Sep 17 00:00:00 2001 From: abiyasa05 Date: Sat, 12 Apr 2025 09:26:04 +0700 Subject: [PATCH] update: tidy up questions and question navigation --- .../student/assessments/assessment.blade.php | 94 +++++++++++++++---- 1 file changed, 74 insertions(+), 20 deletions(-) diff --git a/Penilaian Literasi/iClOP-V2/resources/views/literacy/student/assessments/assessment.blade.php b/Penilaian Literasi/iClOP-V2/resources/views/literacy/student/assessments/assessment.blade.php index 8821e4b..37058c5 100644 --- a/Penilaian Literasi/iClOP-V2/resources/views/literacy/student/assessments/assessment.blade.php +++ b/Penilaian Literasi/iClOP-V2/resources/views/literacy/student/assessments/assessment.blade.php @@ -296,6 +296,7 @@ @php + use Illuminate\Support\Str; $multipleChoiceQuestions = $questions->filter(fn($q) => $q->options->isNotEmpty()); $essayQuestions = $questions->filter(fn($q) => $q->options->isEmpty()); $multipleChoiceNumber = 0; @@ -304,30 +305,55 @@
-
+
@if ($multipleChoiceQuestions->isNotEmpty()) -

Bagian 1: Pilihan Ganda

+

Bagian 1: Pilihan Ganda

Pilih salah satu jawaban yang paling tepat.

@foreach ($multipleChoiceQuestions as $question) @php $multipleChoiceNumber++; $savedAnswer = optional($question->answers->where('assessment_id', $assessment->id)->first()); + $kutipan = null; + $pertanyaanBersih = $question->question_text; + + // Deteksi apakah soal memuat kutipan atau paragraf + if (Str::contains($question->question_text, 'Bacalah')) { + preg_match('/Bacalah (kutipan|paragraf) berikut:\s*"(.*?)"\s*(.*)/s', $question->question_text, $matches); + if (count($matches) >= 4) { + $kutipan = trim($matches[2]); + $pertanyaanBersih = trim($matches[3]); + } + } @endphp +
-
- {{ $multipleChoiceNumber }}. {{ $question->question_text }} -
+
+ +
+ {{ $multipleChoiceNumber }}. +
+ +
+ @if ($kutipan) +

Bacalah kutipan berikut:

+
+ "{{ $kutipan }}" +
+ @endif +

{{ $pertanyaanBersih }}

+
+
@foreach ($question->options as $option) -