-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Specify when formIndex should be updated when there are errors during validating answers #5848
Conversation
59e08e0
to
ea5f173
Compare
ea5f173
to
03acf37
Compare
0ca7b0d
to
5fbab38
Compare
I do think this is the better long term move, but I agree that it would require a little more of a rethink around the interface than we'll want to do for this bug fix. |
Can you check the form mentioned in the issue (two-question-required.xml.txt))? Central can't upload the form because there isn't meta group in the form. |
I took it from our tests but it could be any form with two questions (the second one should be required). This one should work: |
Tested with Success! Verified on device with Android 13 Verified cases:
|
Tested with Success! Verified on device with Android 10 |
Specify when formIndex should be updated when there are errors during validating answers
Specify when formIndex should be updated when there are errors during validating answers
Closes #5847
Why is this the best possible solution? Were any other approaches considered?
The problem was that every time we validated a form if there were errors the form index was changed. This should not happen if we just save the form using the save icon from the toolbar (we still need to validate answers to know if there are errors in this case). Updating the index is needed when we
Check for errors
or try to finalize a form to move a user to the invalid question. So the solution was to introduce a new parameter to explicitly tell the method that validates answers if the index should be updated.Another option would be to move updating index out of the
validateAnswers
method but then we would need to add this to more than one method and those methods are not better places for such an operation.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
We need to test validating answers carefully:
Check for errors
option from the toolbar (with errors)Do we need any specific form for testing your changes? If so, please attach one.
Any form with required questions that could be invalid so required questions without answers or questions with constraints.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.