-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix part of #5070: In FractionInteraction UI, leave submit button enabled when answer is empty #5197
Conversation
… empty. Show an error on submitting an empty answer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masclot, this approach looks okay to me.
It would also be nice to see an example of how you will handle the specific messages listed in oppia/design-team#71 (comment)
if (answerText.isNotEmpty()) { | ||
pendingAnswerError = | ||
FractionParsingUiError.createFromParsingError( | ||
fractionParser.getRealTimeAnswerError(answerText.toString()) | ||
).getErrorMessageFromStringRes(resourceHandler) | ||
} else { | ||
pendingAnswerError = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (answerText.isNotEmpty()) { | |
pendingAnswerError = | |
FractionParsingUiError.createFromParsingError( | |
fractionParser.getRealTimeAnswerError(answerText.toString()) | |
).getErrorMessageFromStringRes(resourceHandler) | |
} else { | |
pendingAnswerError = null | |
pendingAnswerError = if (answerText.isNotEmpty()) { | |
FractionParsingUiError.createFromParsingError( | |
fractionParser.getRealTimeAnswerError(answerText.toString()) | |
).getErrorMessageFromStringRes(resourceHandler) | |
} else { | |
null | |
} | |
} |
Thanks @masclot. I think the solution in the video also looks good, and I took a quick scan at the implementation (but I'm mostly deferring to Adhiambo for that). Could you also add tests for this change? I think either StateFragmentTest or StateFragmentLocalTest would be a good fit (based on whichever currently contains the tests for fraction input errors). It'd be useful to test the different new scenarios of where the submit button is enabled when empty. |
Hi @masclot, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Fix part of #5070: In FractionInteraction UI, leave submit button enabled when answer is empty. Show an error on submitting an empty answer. The error message already exists and is the same as in web.
Demo video: leave_submit_button_enabled_on_empty_answer_v2.webm
Explanation
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then: