AOSSIE-Org / AOSSIE-Org/EduAid

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

Abierto
#575 2 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
JavaScript
Estrellas
171
Forks
425
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.