Skip to content
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

Set responses to null when they become invisible #1617

Open
CarlosNZ opened this issue Nov 27, 2023 · 2 comments
Open

Set responses to null when they become invisible #1617

CarlosNZ opened this issue Nov 27, 2023 · 2 comments
Labels
Feature: improvement Improvement to existing feature importance: Should have Issue that should be included, not needed in MVP

Comments

@CarlosNZ
Copy link
Collaborator

There is a potential problem when a user selects a value that makes another response invisible. If they'd already answered that other question, then their response is preserved, which may effect logic further downstream.

It's possible to include additional logic to check for the original visibility condition in later actions, but this is quite a bit of extra hassle and makes the queries unnecessarily complicated. I think it would be better to automatically set responses to null whenever they go invisible. This would prevent many potential bugs.

@CarlosNZ CarlosNZ added Feature: improvement Improvement to existing feature importance: Should have Issue that should be included, not needed in MVP labels Nov 27, 2023
@CarlosNZ
Copy link
Collaborator Author

Not sure if this will become important for Angola, but if it does I'd much rather make this improvement than add a bunch of additional protective logic to existing templates.

@jagoje

@CarlosNZ
Copy link
Collaborator Author

CarlosNZ commented Dec 1, 2023

This requires a bit of discussion, as there are advantages to leaving it the way it is -- namely, if you change a value, which hides one of your existing responses, then change it back again, it's nice if you're previous response (that got hidden) remains in place.

There are a few options:

  1. Leave as is (with all the potential problems it can cause)
  2. Clear responses as soon as they go invisible (this would be the simplest, but has the downside mentioned above)
  3. Clear hidden responses on Submission (this is good for Actions, but still has the original logic problems when it comes to interaction of form elements while filling the application)
  4. Clear responses after a timeout (e.g. 5 seconds) once they become invisible (this seems good, but might be weird if the effects of it cause other elements to change 5 seconds later)
  5. Make it configurable on a per-question basis (not sure what the default would be though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: improvement Improvement to existing feature importance: Should have Issue that should be included, not needed in MVP
Projects
None yet
Development

No branches or pull requests

1 participant