Skip to content

Bug: Bare number accepted as valid equation — no operator required #10

@Bindkushal

Description

@Bindkushal

What's the bug?

Two rules are not being enforced when input is typed via keyboard:

  1. Broken buttons (shown in red) can be bypassed by typing on the keyboard.
  2. Just typing the target number directly (e.g. 116) is accepted as a valid equation — no operators needed.

Steps to verify the bug

  1. Run the activity
  2. Note the broken buttons (e.g. 0, 3, 9 shown in red)
  3. Note the target number (e.g. 116)
  4. Type 116 directly using your keyboard (don't click any buttons)
  5. Press Enter
    That was my target, your target will be different

Result: 116 = 116 accepted, +17 pts awarded
Expected: Should be rejected — broken digit used + no operator present

Why this happens

Broken button validation only blocks on-screen button clicks. The equation validator doesn't check whether the typed string contains broken digits.

Suggested Fix

The validator should also check:

  • Does the equation contain actual target digits? → reject
  • Does the equation have at least one operator? → reject if not

Screenshot

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions