-
Notifications
You must be signed in to change notification settings - Fork 229
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 making countdown-widgets required
in forms
#8681
Comments
@jkuester The request is for the preceding question to be restricted / dependent on the successful completion of the timer after 60 seconds / one minute. Countdown.timer.webm |
I just wanted to capture a few more details about this request based on today's conversations! The main pain point that this feature would address is ensuring data accuracy in forms that involve a timer, For example, when capturing a value for Breaths per Minute, we can only get an accurate count of breaths when they are tracked for the full minute. Requiring the Breaths per Minute question does ensure that we get a value, but being able to also require the timer to be run would help to ensure that the provided value was accurate! Also, it seems that modeling the countdown timer as a |
@Kymoraa and Abigael, here are some additional design considerations I had after taking a closer look at the code:
|
Okay, now that @SheilaAbby has got us some working code to play around with, I think we have been able to shake out the majority of the complexities here and can land on a particular functionality. @garethbowen please let me know what you think (as this proposal does result in a change to how we would recommend representing timers in xforms)! Design proposalCurrently, the count-down timer widget works by putting the My proposal is we deprecate In my opinion, a |
I think that's a big improvement! I have no problem deprecating the old widget definition and maintaining it till the next major (or beyond if necessary). I imagine the code will be reused for this anyway. The new design looks much more idiomatic of Enketo forms and like you say it means we can leverage this elsewhere with require to give designers more flexibility. Do you know if the |
Thanks @garethbowen!
|
@jkuester Thank you for the valuable suggestions. I've attempted to integrate the timer widget with a please find attached screenshot Supporting the timer on a text question type won’t introduce an extra question on the form requiring a user to input a value. Surprisingly, I have observed it is possible to leave the see, ![]() |
👍 Yes, we have a bit more logic to add to get everything working like we need it. Currently, the textbox for the string/note question is actually being hidden by some CSS (which is why you do not see it for questions of that type). We should be able to do the same for that |
So, in today's episode of why we cannot have nice things... it turns out my previous comment about how parameters should work fine for us, is wrong.... Apparently, in Pyxform, all the supported parameters are actually hard-coded for each question type and only those values are loaded. So, we cannot make-up custom params for This does leave us in a bit of a dilemma here, though. Here are the options I have thought of:
|
Actually got a response already from ODK out on the Pyxform thread! TLDR is that they do not think we should be trying to use the properties column like this. BUT, they pointed me to this doc for the instance/bind/body extension columns and this more or less reinforces exactly what I was suggesting in I am going to dig deeper on this next week and try to put together a more detailed proposal! |
Sounds like |
Okay, @garethbowen, hopefully the last request for design review! I think we should support a workflow where the xlsxform looks like:
Pyxform will automatically load data from the instance::cht::properties column into the form xml (as it is currently doing for This seems to me to be the best balance of following the standards, getting the functionality we need, and not being too difficult to implement/maintain. There are a couple questions this does raise:
Let me know what you think or if you have any better ideas for how to approach this! Thanks! |
If our implementation for db-doc didn't exist then I think I prefer more columns with simple values (option 2). Defining properties is rare so far so I don't think it'll explode the number of columns in every xform. However I really don't like the idea of custom xsl. Can we use the same approach as 1 while using multiple columns like in 2? If the answer is complicated (and I suspect it is) feel free to grab me for a call! |
@jkuester @garethbowen Some great ideas here! But putting them into action seems a bit tricky to me! Also, just a heads up, workflow devs can still use the 'default' column for setting custom timer durations....so basically am not setting any default value on the fields with the countdown timer appearance...but when the timer completes running, the field will be set to contain a |
@SheilaAbby Thanks for the patience here as we work through the best way to add support. It is true that the scope is shifting a bit here. My proposal, is that you and I work together to land this! You can keep focused on the countdown-timer widget code (I think we are pretty close on this code, just need to get some tests). And I will jump in and make the code changes needed on the api side to get the data we need from the xform. How does that sound? |
Had a brief discussion with @garethbowen today and we landed on this design approach: Xlsxform:
api/generate-xform service:
webapp/countdown-timer widget:
|
required
in formsrequired
in forms
@garethbowen I have run into a challenge with using a custom namespace for the xlsx column name (e.g. Assuming there is no convenient library available for de-serializing this data, it seems like our options are:
|
Okay. That's really painful! I think the answer is some form of (3). I have no strong preference now about whether we use the With (4), I'm not sure if they'll want to support JSON in xml, but you should be able to namespace the attribute somehow, eg: |
Logged a Pyxform issue! XLSForm/pyxform#696 My vote is we wait a bit to see what the reaction is to the Pyxform suggestion. If they are open to changing that behavior, then maybe we can get away with |
Update from the Pyxform issue! It turns out I just cannot read properly (even typoed several times in this thread). I thought the spec said to use |
Completed in 3e91ea6 |
Is your feature request related to a problem? Please describe.
Currently, when including the
countdown-widget
in a form, there is no way to ensure that the widget was actually used when filling out the form. Users can simply skip the widget and continue to fill out the form without waiting for the timer to run.Describe the solution you'd like
It seems like the cleanest way to proceed would be to have the
required
value be respected for fields with thecountdown-timer
appearance. This way, a form designer could control whether or not the user has to use the timer by setting therequired
expression (and, by default, the behavior would remain the same as now where a user is not required to wait on the timer).Additional context
This is a feature request from a partner.
Implementing this could be tricky since currently the
countdown-widget
operates as anote
field in the form. Thenote
fields actually cannot berequired
in recent versions of Enekto (since objectively it does not really make sense to require a note). So, we may need to support using thecountdown-timer
appearance on a different type of question besidesnote
. Options off the to of my head are:boolean
field that is set totrue
when the timer completes, orinteger
field that contains the number of seconds remaining on the timer.The text was updated successfully, but these errors were encountered: