-
Notifications
You must be signed in to change notification settings - Fork 273
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
support validating responses in the UI #34
Comments
an additional guide on inline validation in web forms: also, a nice reminder about what to do/what not to do in forms: |
For NCS need to verify the formats of various inputs. Ex : FORMAT MUST BE AA # # # # # # #-UR## |
So, to be clear: there is no support for validation of answers? What about validation of a collection of answers (e.g., a_1 + a_2 + a_3 == 100)? |
There is on the back end, but it doesn't appear in the UI yet. We don't have a syntax yet for the validation of a collection of answers. But there are dependencies that could work on a collection of answers. |
Moving validations to the client side would have the same effects as moving dependencies to the client side - a lack of awareness of responses outside of the current section. We should build consensus on how to implement this both in the short and longer terms. |
I'm hesitant to add this to the core UI. Different people will want to handle invalid answers differently. I've had two separate requests/workflows from users on how to handle invalid questions. If we do implement in the core, it should be in a way that's easy to turn off or override. |
I agree with @kumbafu — Surveyor should not enforce validations unless that enforcement can be customized/disabled. It should provide a mechanism that:
It may also need to provide an extension point for displaying validation messages in the UI. I'm not quite sure how that would work; maybe one part would be including validation information in the AJAX HTTP response when a question response is submitted. It may also be worthwhile to make the validation syntax in the DSL extensible so that applications can define their own sorts of validations.
@kumbafu, it would be helpful to have the parameters for those workflows to ensure that Surveyor's validation implementation would enable (and not obstruct) them. |
The two workflows I've been asked for are:
|
We will implement: Client side: mandatory questions and data types (e.g. integer, date, string) |
Added required if question is marked as mandatory Also preliminary support for type checking (:float, :integer, :time) Using jqueryvalidation.org for client side validation NUBIC#34
was this implemented? |
No issue #34 has not yet been implemented. There is a branch[1] that was started which uses Jquery.validations[2][3] However this was just a start and there are several other issues to Hopefully I, or someone, can pick it up again soon. Kind regards, [1] https://github.com/NUBIC/surveyor/compare/34_support-validations From: Alessandro Lepore notifications@github.com was this implemented? |
Surveyor's Validation model now determines whether or not an answer is_valid? per the criteria set out by the author of the survey. This functionality is not yet hooked into the views, and needs to be implemented in a style similar to Question and QuestionGroup Dependencies.
The text was updated successfully, but these errors were encountered: