@extends('layouts.siswa') @section('title', 'Hasil — ' . $tugas->indikator->deskripsi) @section('kelas-label', $tugas->kelas->nama) @php $totalPoinSiswa = \App\Models\JawabanSession::where('siswa_id', auth()->id())->where('selesai', true)->sum('skor'); @endphp @section('total-poin', $totalPoinSiswa) @section('topbar')
← Beranda
{{ $tugas->indikator->deskripsi }}
{{ $tugas->kelas->nama }}
@endsection @section('content') @php $s = $session->skor; $benar = $jawaban->filter(fn($j) => $j->pilihan->adalah_benar)->count(); $salah = $jawaban->count() - $benar; $warnaS = $s >= 70 ? '#16a34a' : ($s >= 50 ? '#d97706' : '#dc2626'); $emoji = $s >= 90 ? '🎉' : ($s >= 70 ? '😊' : ($s >= 50 ? '💪' : '🌱')); $judul = $s >= 90 ? 'Wah, sempurna!' : ($s >= 70 ? 'Wah, hebat!' : ($s >= 50 ? 'Bagus, terus semangat!' : 'Yuk, coba lagi!')); $bintang = $s >= 90 ? 5 : ($s >= 70 ? 4 : ($s >= 50 ? 3 : ($s >= 30 ? 2 : 1))); @endphp
{{-- Skor header --}}
{{ $emoji }}
{{ $judul }}
Kamu sudah menyelesaikan tugas ini.
{{ $s }}%
{{ str_repeat('★', $bintang) }}{{ str_repeat('☆', 5 - $bintang) }}
✅ {{ $benar }}
Benar
❌ {{ $salah }}
Salah
📝 {{ $jawaban->count() }}
Total Soal
{{-- Narasi AI --}}
💬 Feedback untukmu
{{ $narasi }}
{{-- Miskonsepsi (jika ada) --}} @if($miskonsepsi->isNotEmpty())
🔍 Yang perlu diperhatikan:
@foreach($miskonsepsi as $m)
{{ $m->label }}
{{ $m->narasi_siswa }}
@endforeach
@endif {{-- Pembahasan --}}
📖 Pembahasan ({{ $jawaban->count() }} Soal) Klik soal untuk lihat detail
@foreach($jawaban as $idx => $j) @php $benarJ = $j->pilihan->adalah_benar; $jawabanBenar = $j->soal->pilihan->firstWhere('adalah_benar', true); @endphp
{{ $idx + 1 }}
{{ \Str::limit($j->soal->pertanyaan, 70) }}
{{ $benarJ ? '✅' : '❌' }}
{!! nl2br(e($j->soal->pertanyaan)) !!}
@if($j->soal->gambar)
gambar
@endif
Jawabanmu
{{ $benarJ ? '✅' : '❌' }} {{ $j->pilihan->teks }}
@if(!$benarJ && $jawabanBenar)
Jawaban Benar
✅ {{ $jawabanBenar->teks }}
@endif
@if(!$benarJ && $j->pilihan->miskonsepsi)
🤔 {{ $j->pilihan->miskonsepsi->narasi_siswa }}
@endif
@endforeach
{{-- Aksi --}}
🏠 Kembali ke Beranda 📊 Semua Hasil Saya
@endsection @section('scripts') @endsection