{{ $quiz->title }}

@php $stars = 0; if ($attempt->score >= 90) $stars = 3; elseif ($attempt->score >= 70) $stars = 2; elseif ($attempt->score >= 40) $stars = 1; @endphp
@for($i = 1; $i <= 3; $i++) @endfor
@php $circumference = 453; // Rounded up slightly to prevent repeatable dash overlap $targetOffset = $circumference - ($circumference * $attempt->score / 100); $duration = 1500; $interval = $attempt->score > 0 ? $duration / $attempt->score : 1000; @endphp
0%
@if($attempt->score >= 90)

Absolutely Brilliant! 🧠

You're a Biology master!

@elseif($attempt->score >= 70)

Great Job! 🎉

Strong performance — keep pushing!

@elseif($attempt->score >= 40)

Good Effort! 📚

Review the material and try again.

@else

Keep Practising! 💪

Every attempt makes you better!

@endif

Score: {{ $attempt->score }}%

@if($isFirstAttempt)
🏆
Cups Earned {{ $attempt->earned_cups > 0 ? '+' : '' }}{{ $attempt->earned_cups }} cups
@endif
Review Answers
@php $questionGroups = $attempt->answers->groupBy('question_id'); @endphp @foreach($quiz->questions as $index => $question) @php $studentResponses = $questionGroups->get($question->id); $isEntirelyCorrect = $studentResponses ? $studentResponses->every('is_correct') : false; @endphp
Question {{ $index + 1 }}
{{ $isEntirelyCorrect ? 'Correct' : 'Needs Review' }}

{{ $question->text_content }}

@if($question->image_path && $question->type !== 'drag_drop')
@endif @if($question->type === 'drag_drop')
@foreach($studentResponses ?? [] as $response) @php $hotspot = $response->hotspot; @endphp
{{ $response->is_correct ? '✓' : '✗' }}
@if($response->is_correct) {{ $response->answer->content }} @else
{{ $response->answer ? $response->answer->content : 'Empty' }} {{ $hotspot?->content ?? 'Unknown hotspot' }}
@endif
@endforeach
Hotspot Breakdown
@foreach($studentResponses ?? [] as $response) @php $hotspot = $response->hotspot; @endphp
{{ $response->is_correct ? '✓' : '✗' }}

Target

{{ $hotspot?->content ?? 'Unknown' }}

@if(!$response->is_correct)

Your Choice

{{ $response->answer ? $response->answer->content : 'Nothing' }}

@endif
@endforeach
@else
@php $studentChoice = $studentResponses ? $studentResponses->first() : null; @endphp @foreach($question->answers as $option)
@if($option->is_correct)
@elseif($studentChoice && $studentChoice->answer_id == $option->id)
@else
@endif
@if($question->type === 'image' && $option->image_path) @else {{ $option->content }} @endif
@endforeach
@endif @if($question->definition)
Explanation

{{ $question->definition }}

@endif
@endforeach