> Placeholder mini-quiz; future = DB-loaded items */ protected array $steps = [ ['question' => 'Was ergibt 12 × 8?', 'options' => ['64', '88', '96', '102'], 'correct' => 2], ['question' => 'Was ergibt 15 × 7?', 'options' => ['95', '105', '115', '125'], 'correct' => 1], ['question' => 'Was ergibt 9 × 11?', 'options' => ['91', '99', '108', '111'], 'correct' => 1], ['question' => 'Was ergibt 14 × 6?', 'options' => ['72', '78', '84', '88'], 'correct' => 2], ]; public function mount(array $task = []): void { $this->task = $task; $this->totalSteps = count($this->steps); } public function currentQuestion(): array { return $this->steps[$this->currentStep - 1] ?? $this->steps[0]; } public function submitAnswer(int $optionIndex): void { $q = $this->currentQuestion(); if ($optionIndex === ($q['correct'] ?? -1)) { $this->correctAnswers++; } if ($this->currentStep >= $this->totalSteps) { $this->finished = true; return; } $this->currentStep++; $this->answer = null; } public function restart(): void { $this->currentStep = 1; $this->finished = false; $this->correctAnswers = 0; $this->answer = null; } public static function modalMaxWidth(): string { return '2xl'; } public static function closeModalOnClickAway(): bool { return false; } public function render(): View { return view('livewire.tasks.modals.runner'); } }