SEL-Columbia / enketo

A lightweight offline-capable web survey application that is compatible with JavaRosa/OpenRosa XForm-derived format and compliant servers.
https://enketo.org
Apache License 2.0
16 stars 13 forks source link

Should the first repeat not be created automatically like in ODK Collect? #502

Open MartijnR opened 11 years ago

MartijnR commented 11 years ago

Enketo always creates the first repeat instead of asking for it like ODK Collect does. This deviates from the spec, but I thought (and still think) it generally results in a better user experience. Though clearly, there are use cases (currently, one came up in Dristhi) where it would be better to use ODK's approach.

In this case, I don't think there should be drishti-specific change but a global one if we decide to do so.

kirang20 commented 11 years ago

If there is one sub-form instance that is always created (in the JSON that is passed to ziggy) then by looking at the field values we cannot determine if the instance was created by default or by ANM. This is because all values being empty can also mean that the ANM left the answers blank! So how do we handle the Still birth case where no children should be created? We feel that this problem is not same as Enketo creating the first repeat by default, that can still continue to happen but when the whole repeat is hidden (in case of Still birth) then the instances list in the JSON should be left empty. Here is a link to the form for reference, https://formhub.org/drishti_forms/forms/Delivery_Outcome_EngKan. Thoughts?

MartijnR commented 11 years ago

I do think the problem really boils down to the default automatic first-instance creation (in XML and therefore in JSON).

The first repeat instance is always there and is always automatic. If the values are empty this could indeed either be because it was not relevant or because the user didn't enter values.

Still not sure if we should change this and still think that if we do, it should be a global change (XML + JSON).

kirang20 commented 11 years ago

So our problem is we cannot distinguish between user adding one instance to the repeat group (live birth) and leaving all questions unanswered and user not even adding one instance (still birth - which now creates an empty instance). From a usability perspective it makes sense to add a default instance so I would not want that to be changed. I do not have much understanding of how repeats are implemented in Enketo and hence may be I still feel that the default instance being added on UI and a default instance being added to JSON as two different things. We can hack around this issue for now by looking at whether the outcome was live birth or still birth, but I am just worried that with this approach of mapping repeats in JSON we will hit an issue where we cannot distinguish between where user created empty instance or enketo created a default empty instance.

MartijnR commented 10 years ago

@dorey mentioned:

"allow deletion of automatically created first repeat"