-
Notifications
You must be signed in to change notification settings - Fork 8
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
Remove unvalidated answers from answer file #265
Comments
If they are using the date field, that should be using the html date input in which case I'm not sure how it would be possible to enter a partial date. We should be able to validate more often to remove nulls or at least improve validation before save |
I'm able to replicate it, but it requires a 2 pass at answering the question. Here's a test GI.
|
well it turns out that is a text input not a date. Is there any situation where an author would allow partial dates? I'm wondering if fixing this might break old guides. |
What is a text input? My example GI? I think date fields can be locked to full dates. If an author wants a partial date, they can use a text field. There are some cases where a partial date might be wanted, like "Tell me the approximate month and year this happened" |
the html standard differentiates between text and dates. The input type used for the date field is a text input with a jquery date-picker |
Feature request to solve the following author (LHI) reported issue:
There is question in the interview that asks whether the user knows a birth date. If they say yes, they are taken to the next screen, where they must enter a valid date to continue. If they try to enter a partial date (say just month and day) they get a message saying date is invalid and cannot continue. However, they are instructed that if they don't know the date, they should use the Back button and change their answer regarding knowing the date. If they enter an invalid date and then hit the Back button, the invalid date is preserved in the answer file.
Author hack - corrected this issue by setting the date to NULL if the user says they don't know the date.
However, is there a way to delete these partial answers from the answer file, without relying on the author to include the hack? I'm thinking we'd need to change the code to prevent an actual save to the answer file until any field validation in place actually ran. The current state is that the user's answer is saved to the answer file in a temporary state (as witnessed by the inclusion in the preview mode debug panel) and then a field validator is run against that when the button is clicked.
In this one type of case, that validation isn't coming soon enough. The "bad" answer is getting stored in the temporary state and never cleared out if the user navigates back to prior questions.
We can't just clear answers with a back button either, because I can foresee potential unintended consequences where you wouldn't want a user's answer cleared just because they clicked back.
Maybe we can run the validator on any button click or attempt to navigate out of the page the user is currently on. If they then try to navigate away, the error messaging would tell them they have a bad date and to fix it or delete it.
The text was updated successfully, but these errors were encountered: