{{-- 機器人模擬器(瀏覽器內執行,不連接真實硬體)。$lesson->config 內含機器人、場地、任務 --}} @php $cfg = $lesson->config ?? []; $tasks = collect($cfg['tasks'] ?? [])->map(fn ($t) => ['title' => $t['title'] ?? '', 'hint' => $t['hint'] ?? null])->values(); $alreadyDone = auth()->user()->progress()->where('lesson_id', $lesson->id)->whereNotNull('completed_at')->exists(); $clientCfg = collect($cfg)->except('solution')->all(); // 解答不送到瀏覽器 @endphp