Assessment Result
+Detail Jawaban
+ + +Ringkasan Jawaban
++ Benar: {{ $totalBenar }} | + Salah: {{ $totalSalah }} +
+ + +-
+ @foreach ($questions as $index => $question)
+ @php
+ $answer = $question->answers->first();
+ $isCorrect = false;
+
+ if ($question->type === 'multiple_choice' && $answer) {
+ $isCorrect = $answer->option->is_correct;
+ } elseif ($question->type === 'essay') {
+ $isCorrect = strtolower(trim($answer->answer_text)) === strtolower(trim($question->essay_answer));
+ }
+ @endphp
+
-
+ + {{ $index + 1 }}. {{ $question->question_text }} + @if ($isCorrect) + Benar ✅ + @else + Salah ❌ + @endif ++ +
+ Jawaban Anda: + @if ($question->type === 'multiple_choice') + {{ optional($answer)->option->option_text ?? 'Tidak Dijawab' }} + @else + {{ optional($answer)->answer_text ?? 'Tidak Dijawab' }} + @endif +
+ + @if ($question->type === 'essay') ++ Feedback: + {{ optional($answer)->feedback ?? 'Tidak ada feedback' }} +
+ @endif +
+ @endforeach
+
+
+