Skip to content

QuizPanel strands the user on a blank screen when a quiz generates zero questions #184

@Jose-Gael-Cruz-Lopez

Description

@Jose-Gael-Cruz-Lopez

Severity: Medium
Labels: bug, frontend, P2
Location: frontend/src/components/QuizPanel.tsx:86-95 (start), active-phase guard :202

Description

start() does setQuestions(res.questions || []) then setPhase("active") unconditionally. The active UI is gated {phase === "active" && currentQuestion && ...}; with an empty array currentQuestion is undefined, so nothing renders — no question, no controls (Cancel exists only in the select phase).

Steps to reproduce

  1. Start a quiz on a concept the backend can't generate questions for.
  2. Land on a blank, control-less panel with no way back except hard navigation.

Expected vs actual

  • Expected: an empty-result error and return to select.
  • Actual: silent transition to an empty screen.

Suggested fix

In start(), if questions.length === 0, toast.error(...) and stay in select.

Acceptance criteria

  • A zero-question generation shows an error and keeps the user in the selectable state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritybugSomething isn't workingfrontendFrontend / UI

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions