AOSSIE-Org / AOSSIE-Org/EduAid

[BUG]: Text_Input Page – Trim Input to Fix Empty Quiz Bug

Offen
#572 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
JavaScript
Sterne
171
Forks
425
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Bug Description

Description:
Currently, on the Text_Input page, if a user enters only spaces (e.g., " ") and clicks Next, the app still attempts to generate a quiz. This leads to unnecessary backend calls and can produce empty quizzes.

Expected Behavior:

-Inputs containing only spaces should be treated as empty.
-The app should prevent proceeding to quiz generation if the input is empty.

Proposed Solution:

-Trim the input before validation (input.trim()).
-Only proceed with quiz generation if the trimmed input is non-empty.

Benefits:

-Prevents empty quizzes.
-Saves backend resources.

### Steps to Reproduce

_No response_

### Logs and Screenshots

_No response_

### Environment Details

_No response_

### Impact

Critical - Application is unusable

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.