{{--

Kuiz Risiko Scam

@if (isset($questions[$currentStep]))

Soalan {{ $currentStep + 1 }} daripada {{ count($questions) }}: {{ $questions[$currentStep]->text }}

@php $isSelected = $answers[$currentStep] ?? null; @endphp @foreach ($questions[$currentStep]->answerOptions as $option) @php $isThisOptionSelected = $isSelected == $option->id; $scoreColor = ''; if (!is_null($isSelected)) { $scoreColor = match(true) { $option->score == 0 => 'bg-green-100 text-green-800', $option->score >= 3 => 'bg-red-100 text-red-800', default => 'bg-yellow-100 text-yellow-800', }; } $selectedClass = $isThisOptionSelected ? 'ring-2 ring-offset-1 ring-blue-500' : ''; @endphp @endforeach
@php $selectedOption = $questions[$currentStep]->answerOptions->firstWhere('id', $answers[$currentStep] ?? null); @endphp @if (!is_null($selectedOption))
Tips:

{{ $questions[$currentStep]->tips ?? 'Tiada tips khusus untuk soalan ini.' }}

@endif
@if ($currentStep > 0) @endif @if ($currentStep < count($questions) - 1) @else @endif
@endif
--}}

Kuiz Risiko Scam

@guest
Login dengan Google
@endguest
@if (isset($questions[$currentStep]))

Soalan {{ $currentStep + 1 }} daripada {{ count($questions) }}: {{ $questions[$currentStep]->text }}

@php $isSelected = $answers[$currentStep] ?? null; @endphp @foreach ($questions[$currentStep]->answerOptions as $option) @php $isThisOptionSelected = $isSelected == $option->id; $scoreColor = ''; if (!is_null($isSelected)) { $scoreColor = match(true) { $option->score == 0 => 'bg-green-100 text-green-800', $option->score >= 3 => 'bg-red-100 text-red-800', default => 'bg-yellow-100 text-yellow-800', }; } $selectedClass = $isThisOptionSelected ? 'ring-2 ring-offset-1 ring-blue-500' : ''; @endphp @php $selected = isset($answers[$currentStep]) && $answers[$currentStep] == $option->id; $hasAnswered = isset($answers[$currentStep]); $scoreColor = $hasAnswered ? ($option->score == 0 ? 'bg-green-100 border-green-500' : ($option->score >= 4 ? 'bg-red-100 border-red-500' : 'bg-yellow-100 border-yellow-500')) : 'bg-white border-gray-300'; $selectedClass = $selected ? 'ring-2 ring-blue-400' : ''; $cursorClass = $hasAnswered ? 'cursor-not-allowed' : 'cursor-pointer'; @endphp @endforeach
@php $selectedOption = $questions[$currentStep]->answerOptions->firstWhere('id', $answers[$currentStep] ?? null); @endphp @if (!is_null($selectedOption))
Tips:

{{ $questions[$currentStep]->tips ?? 'Tiada tips khusus untuk soalan ini.' }}

@endif
@if ($currentStep > 0) @endif @if ($currentStep < count($questions) - 1) @else @endif
@endif