AOSSIE-Org / AOSSIE-Org/EduAid

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

Aperta
#572 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
JavaScript
Stelle
171
Fork
425
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.