Feedback needed: Enketo relevance change to align with ODK Collect

Trevor (@eyelidlessness) and I have been leading the development of Enketo as @martijnr has reduced his involvement (we’re grateful for his continued collaboration!).

We’d like your help validating an update that makes performance improvements and a change to relevance to align with ODK Collect.

Help needed

Please either share your complex forms in this thread, private message them to me, or try them yourself in the Enketo preview available at https://getodk.org/xlsform. This is running new code we would like to verify against your forms. The things to look for are unexpected behavior (e.g. a calculation not having the value you expect, a question appearing when you expect it to be hidden) or poor performance. Issues are most likely to show up in nested repeats or with calculations/relevance statements that involve many other questions.

What has changed

Performance. The new release includes several performance improvements including a risky one that’s off by default (see below). Forms with repeats in particular should load more quickly.

Relevance. Non-relevant values in Enketo have historically been used in all calculations including in relevance conditions for future questions, a deviation from ODK Collect. This means that values that are not displayed can still affect the behavior of the form. This can cause unexpected behavior when editing existing answers either within a form filling session or on the server after submission. This change does NOT affect submissions: non-relevant values have always been omitted from submissions.

Consider this form definition and animated gif below. The Enketo 3.x (currently deployed) behavior is on the left and the Enketo 4.x (upcoming, matches ODK Collect) is on the right.
enketo-3.x enketo-4.x

With Enketo 3.x and prior, if you answer ‘yes’, ‘yes’, ‘no’ and then change the phone_ring to ‘no’, the speak_english question and the ineligibility message will still be displayed.

With the change we have made, non-relevant fields, including fields in non-relevant groups or repeats, will always evaluate to blank. The speak_english question and the ineligibility message will therefore be hidden when the phone_ring is changed to ‘no’. However, the values will still be maintained so that if you change the phone_ring back to ‘yes’, all of the previously-captured answers will be restored. This behavior matches ODK Collect.

We have turned on the new behavior at https://getodk.org/xlsform. The change is part of the Enketo 4.x release but off by default. We intend to turn it on for the Central v1.6 release (Fall 2022).

Bonus

We have an additional riskier performance improvement that we are considering. This is most likely to help forms with relevant or calculate expressions that reference or affect many questions (e.g. 500 questions shown or hidden by a consent question).

If you have a slow form, you can try this by adding &computeAsync to the end of the preview link (click in the address bar and paste it at the end). The things to look for here are visual glitches and unexpected computation results.

If your form does feel faster, please let us know. If we don’t receive feedback that it is helpful, we will remove it.

3 Likes

So great to see these improvements! Thanks to you both for this and for all the other work to move Enketo forward. I hope people can help test these exciting changes.

1 Like

This is great!

We would like to check if this issue: https://github.com/enketo/enketo-express/issues/388 has been solved. We cannot upload supporting files with https://getodk.org/xlsform so maybe you can check?

Thanks

1 Like

Thanks, @martijnr!

@qlands looks like it was a form design issue! Consider posting those kinds of questions to the support category here. Looking forward to your feedback on these updates!

Great to see these improvements