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

Ietestform - Suggestion: check for 'other' text field #117

Open
stevenglover opened this issue Aug 19, 2019 · 2 comments
Open

Ietestform - Suggestion: check for 'other' text field #117

stevenglover opened this issue Aug 19, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@stevenglover
Copy link

Check that there is an associated text field whenever 'other' is listed as a choice in a select_one or _multiple fields. Generate warning if text field doesn't exist or relevance isn't coded correctly.

I suppose this would need users to define a standard value that 'other, specify' is coded as in the input to running iefieldkit.

@kbjarkefur kbjarkefur changed the title Suggestion: check for 'other' text field Ietestform - Suggestion: check for 'other' text field Aug 20, 2019
@kbjarkefur kbjarkefur added the enhancement New feature or request label Aug 20, 2019
@kbjarkefur
Copy link
Contributor

Good suggestion! A few thoughts on how to implement.

  • To test which select fields have 'other' option we must test on the string other right? Cause that would mean that we can only do this test on English language forms. Or is there another way?
  • Is there any case when the specify other field does not come directly after the select field? For example:
    • a few questions are asked and then specify other fields for each of them comes all at once afterwards.
    • Or that the select field is a part of appearnce view like field-list and that the specify other question is asked outside the group meaning that there is a end group field in between?

I think it is not too difficult to implement a test for if specify other exist, once we have comprehensively laid out the case how that field can appear.

The most difficult part to code is to test if it is coded correctly, as there could be different styles, multiple conditions (e.g. only ask for specify other if two conditions apply) etc. That part I think is more difficult to implement. Unless we give a warning for all cases that is not coded like the most simple case, and then the user has to ignore the false positives.

@stevenglover
Copy link
Author

Instead of testing on a string, I would test on a unique value assigned to all 'other' option choices. For example, the surveys I program always have -9 for 'other', -8: don't know, -7: refuse, etc... So in this case the test for whether the text specify other field exists could then be for whether the relevance expression exists in any text field for this value. This would require the survey to have a unique value for 'other' choices, and this value to be defined in the ietestform command by the user.

So my idea would be that if a select_one or _multiple has 'othervalue' as a potential choice, then a text field would have either ${question} = 'othervalue' or selected(${question}, 'othervalue') as the relevance. I think this would overcome the issues you mention about the text field not coming directly after.

As you mention, it will be difficult to account for all situations, so therefore best probably to flag as warnings for incorrect cases. Perhaps output like this would be informative:

  1. A list of select_one and _multiple fields that DO NOT have 'othervalue' as a choice option (for manual user checking)
  2. Of those select_one and _multiple fields that DO have an 'other' field as an option, list those that DO NOT have a linked text field with a relevance expression described above (again, to flag for user to check if it functions correctly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants