xforms-spec
xforms-spec copied to clipboard
On relevance being false(), the data node is removed on save, not submission
The spec says when the relevance is false() the data node and its descendants are removed on submission. ODK Collect stores them in memory while the application is open, it persists the relevant values on save and thus on submission. Not sure what Enketo does and that's why I've filed this issue.
In Enketo Express, the irrelevant nodes are removed (not just emptied) when the record is saved as final and can no longer be edited. So this is not upon submission either. Irrelevant nodes are kept when the record is saved and not marked as final.
So it sounds like we do the same (right?) and should edit the spec.
So while a form is actively being filled out, irrelevant nodes are not removed, correct? So, if the node is not removed, are their values 'blanked' in some way instead? Which is to say, if something irrelevant subsequently becomes relevant does their previous (eg default) value remain?
So while a form is actively being filled out, irrelevant nodes are not removed, correct?
Yes, correct.
So, if the node is not removed, are their values 'blanked' in some way instead? Which is to say, if something irrelevant subsequently becomes relevant does their previous (eg default) value remain?
Good question. This is messy in Enketo for historic reasons. Enketo used to keep those nodes and their values untouched until the record was marked as final. At some point, we realized that was wrong and that they should be cleared immediately. This is what the spec should say I think, but would like to hear what others think, and what ODK Collect does.
Unfortunately, by the time we realized this, users had started relying on that incorrect behavior so this is now implemented as a special 'mode' Enketo can run in. Some Enketo applications clear the values immediately to <a></a>
, some don't. Clearing immediately is the default of the form engine but in the main Enketo application used by Ona and KoBoToolbox, this is overridden.
From a user perspective, immediate-clearing can be a total nightmare. For example, take an informed-consent question, upon which 1,000 later questions are hinged (the whole survey ends vs. proceeds). In reviewing the submission at the end, your finger accidentally taps from Yes to No -- perhaps a swipe gone wrong. If in that moment the potentially-multi-hour survey is fully cleared so that, when you change it immediately back to Yes, still you have to re-conduct the whole survey... well, that's a good time for that team to start thinking about another survey technology. :) So, in my view, there were very good reasons why the proactive clearing only happened at finalization time. If ODK Collect were to revert to immediate-clearing, I suspect you'd find a ton of push-back, tremendous pain in the field, and then you'd end up with a "mode" like Martijn's. To avoid all that hassle and heartache, you might just document it as it was originally implemented. I.e., I would label Martijn's revised behavior as the incorrect one. :)
On Thu, Nov 9, 2017 at 4:44 PM Martijn van de Rijdt < [email protected]> wrote:
So while a form is actively being filled out, irrelevant nodes are not removed, correct?
Yes, correct.
So, if the node is not removed, are their values 'blanked' in some way instead? Which is to say, if something irrelevant subsequently becomes relevant does their previous (eg default) value remain?
Good question. This is messy in Enketo for historic reasons. Enketo used to keep those nodes and their values untouched until the record was marked as final. At some point, we realized that was wrong and that they should be cleared immediately. This is what the spec should say I think, but would like to hear what others think, and what ODK Collect does.
Unfortunately, by the time we realized this, users had started relying on that incorrect behavior so this is now implemented as a special 'mode' Enketo can run in. Some Enketo applications clear the values immediately to , some don't. Clearing immediately is the default of the form engine but in the main Enketo application used by Ona and KoBoToolbox, this is overridden.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/opendatakit/xforms-spec/issues/153#issuecomment-343301430, or mute the thread https://github.com/notifications/unsubscribe-auth/AIO0Hv3BGDZXNUx_Vw3MJqM49mQEy7dnks5s03I5gaJpZM4QVrfO .
Another 'issue' with automatically clearing irrelevant nodes is that you effectively loose the ability to pre-populate defaults for (initially) non-relevant properties. By definition, if a node is irrelevant on startup then it should also be wiped - otherwise you rather end up with inconsistent enforcement of the prescribed cleared-if-irrelevant behavior...
So I'm probably leaning towards Chris: its OK to choose not to upload irrelevant properties on form submission (and hide any corresponding control in the GUI). But beyond that yer probably opening pandoras box... :-)
Yes, the accidental data loss is a valid concern. I'll try to find the arguments for introducing the 'clear immediately mode' a while back, but we could probably defend both ways.
Looks like this was never made explicit.
- Non-relevant values including
calculate
s in non-relevant blocks are treated as null in expressions (that is, nodes that users don't see and that will be pruned on finalization are treated as though they weren't there) -
calculate
s still update even when in non-relevant blocks - controls that had a value, became non-relevant, and then became relevant again have their values restored