@extends('layouts.teacher') @section('title', 'Detail Jawaban') @section('header_title', 'Detail Jawaban Siswa') @section('content')
Kembali ke Hasil Ujian

{{ $exam->title }}

Nama Siswa

{{ $student->name }}

NISN

{{ $student->nisn }}

Kelas

{{ $student->class }}

@if(count($attempts) > 1)

Total Attempt

{{ count($attempts) }} Kali

@endif

Nilai Tertinggi

@php // Cari nilai tertinggi dari semua attempt $highestScore = 0; $bestAttempt = null; foreach($attempts as $attempt) { if($attempt['score'] > $highestScore) { $highestScore = $attempt['score']; $bestAttempt = $attempt; } } $isBestPassed = $bestAttempt ? $bestAttempt['is_passed'] : $is_passed; @endphp
{{ $highestScore }}
@if($isBestPassed)
@endif
@if(count($attempts) > 1) (Dari {{ count($attempts) }} kali mengerjakan) @endif
Status: {{ $status }}
@if($submitted_at && $submitted_at !== '-') {{ \Carbon\Carbon::parse($submitted_at)->format('d M Y') }} {{ \Carbon\Carbon::parse($submitted_at)->format('H:i') }} WIB @else - @endif
@if(count($attempts) > 1)

📊 Rekapan Semua Attempt

@foreach($attempts as $index => $attempt)
Attempt {{ $attempt['attempt_number'] ?? ($index + 1) }} @if($attempt['is_best']) Terbaik @endif {{ $attempt['score'] }}
{{ $attempt['submitted_at'] ?? '-' }}
@endforeach
@endif @if(isset($message) && !$has_detailed_answers)

{{ $message }}

@endif
@forelse($questions as $index => $question)
{{ $index + 1 }}

{{ $question['question'] }}

@if($has_detailed_answers) @if($question['student_answer'] === $question['correct_option'])
Benar
@elseif($question['student_answer'] !== null)
Salah
@else
Tidak Dijawab
@endif @else
Jawaban tidak tersimpan
@endif
@if(isset($question['question_image']) && $question['question_image'])
Gambar Soal
@endif
@foreach(['a', 'b', 'c', 'd'] as $option)
{{ strtoupper($option) }}

{{ $question['options'][$option] }}

@if($option === $question['correct_option'])
@elseif($has_detailed_answers && $option === $question['student_answer'])
@endif
@endforeach
@if(count($attempts) > 1 && isset($attempts) && $has_detailed_answers)

📝 Perbandingan Jawaban di Setiap Attempt:

@foreach($attempts as $attempt) @php // PERBAIKAN DI SINI: Gunakan array access bukan method get() $attemptAnswer = null; if(isset($attempt['answers']) && isset($attempt['answers'][$question['id']])) { $attemptAnswer = $attempt['answers'][$question['id']]; } @endphp @endforeach
Attempt Jawaban Siswa Status Nilai Attempt Waktu
Attempt {{ $attempt['attempt_number'] ?? ($loop->index + 1) }} @if($attempt['is_best']) Terbaik @endif
@if($attemptAnswer && isset($attemptAnswer['selected_option']))
{{ strtoupper($attemptAnswer['selected_option']) }} {{ $question['options'][$attemptAnswer['selected_option']] ?? '-' }}
@else - @endif
@if($attemptAnswer) @if($attemptAnswer['selected_option'] === $question['correct_option']) Benar @elseif($attemptAnswer['selected_option']) Salah @else Kosong @endif @else - @endif
{{ $attempt['score'] }} @if($attempt['is_passed']) @else @endif
{{ $attempt['submitted_at'] ?? '-' }}
@endif

Kunci Jawaban:

Jawaban Benar:

{{ strtoupper($question['correct_option']) }} {{ $question['correct_answer'] }}
@if($has_detailed_answers)

Jawaban Siswa (Attempt Terbaik):

Jawaban Siswa:

@if($question['student_answer']) {{ strtoupper($question['student_answer']) }} {{ $question['options'][$question['student_answer']] ?? '-' }} @else Tidak dijawab @endif
@endif
@empty

Belum Ada Soal

Ujian ini belum memiliki soal yang dapat ditampilkan.

@endforelse
@if($has_detailed_answers && isset($statistics) && $statistics['total_questions'] > 0)

📈 Statistik Performa Siswa

{{ $statistics['total_questions'] }}

Total Soal

Semua soal
{{ $statistics['correct_count'] }}

Jawaban Benar

@if($statistics['total_questions'] > 0) {{ number_format(($statistics['correct_count'] / $statistics['total_questions']) * 100, 1) }}% @else 0% @endif
{{ $statistics['wrong_count'] }}

Jawaban Salah

@if($statistics['total_questions'] > 0) {{ number_format(($statistics['wrong_count'] / $statistics['total_questions']) * 100, 1) }}% @else 0% @endif
{{ $statistics['unanswered_count'] }}

Tidak Dijawab

@if($statistics['total_questions'] > 0) {{ number_format(($statistics['unanswered_count'] / $statistics['total_questions']) * 100, 1) }}% @else 0% @endif
@if($statistics['total_questions'] > 0)
Akurasi Jawaban {{ $statistics['accuracy_percentage'] ?? number_format(($statistics['correct_count'] / $statistics['total_questions']) * 100, 1) }}%
@if(count($attempts) > 1)

Perbandingan Semua Attempt:

@foreach($attempts as $attempt)
Attempt {{ $attempt['attempt_number'] ?? ($loop->index + 1) }} @if($attempt['is_best']) Nilai Tertinggi @endif
{{ $attempt['score'] }} ({{ $attempt['submitted_at'] ?? '-' }})
@endforeach
@endif
@endif
@endif
@endsection