AOSSIE-Org / AOSSIE-Org/EduAid

[BUG]: Google Doc error message is treated as quiz input on Text_Input page

Ouverte
#575 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
JavaScript
Étoiles
171
Forks
425
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Bug Description

Problem

On the Text_Input page, when a user enters an invalid Google Doc URL, the request to retrieve the document fails and the following message appears in the textarea:

"Error retrieving Google Doc content"

This message is currently stored in the text state. If the user clicks Next afterwards, the app treats this error message as valid input and sends it to the backend to generate a quiz.

Steps to Reproduce
-Open the Text_Input page.
-Enter an invalid Google Doc URL (e.g., random text).
-Wait for the error message to appear.
-Click Next.

Current Behavior
The error message "Error retrieving Google Doc content" is treated as user input and sent to the backend.

Expected Behavior
Error messages should not be stored in the text state or treated as quiz input.
Instead, they should be displayed separately (e.g., using an error state) and the user should be prompted to provide valid input.

Proposed Fix
-Introduce a separate error state (e.g., inputError).
-Display error messages using this state instead of storing them in text.
-Prevent error messages from being sent to the backend.

Benefits
-Prevents invalid backend requests
-Improves error handling
-Provides better user experience

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.