AOSSIE-Org / AOSSIE-Org/EduAid

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

未关闭
#575 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
JavaScript
星标
171
派生
425
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。