Error on ODK app which is not on Ona webform

Good day,

I have created a survey on Ona and everything works on the webform, with no errors or invalid response feedback. It works perfectly.

However, when I tried to test it on the ODK collect app, my ranking question keeps on providing me with an error and since it is a required question it wont allow me to continue with the survey either.

The error it states is : "each ranking can only be used once" and it is what I want it to state if more than one ranking is selected twice. But I selected each ranking only once and still get this response. Why does this happen on ODK Collect when it works perfectly on the Ona webform and how do I fix it?

Kind re gard,
Natasha

For questions about Ona, you should check out their help center or community forums.

Some good ODK resources for form creation are ODK Build and the XLSForm documentation.

Can you export you survey as an XLSForm and post the problematic question(s) here?

Hi Dan,

The question works perfectly on Ona so the problem is not there. My problem is on ODK Collect, where it won't work.

The XLSForm with this particular question can be found here.

Kind regards,

I realize you are noticing the issue in ODK Collect. But the formbuilder in Ona is not part of the ODK ecosystem. So if you are building a form with that and the result isn't working. Then you need to consult them.

Your prompt is to "rank countries" but your list is not a list of countries.

The constraint message is inconsistent when testing. Sometimes is works and sometimes it doesn't. I was able to complete the question a number of times. I think it has to do with when the constraint is calculated, the order in which the questions were answered, and whether an answer is changed. But I'm not sure.

Using integer questions seemed to work consistently for me, but I didn't test it extensively.

+--------------+--------------+---------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------------------------------+
|    type      |     name     |     label     | appearance |                                                                    constraint                                                                     | required |    constraint_message::English     |
+--------------+--------------+---------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------------------------------+
| begin group  | rank_markets | 1.9.2         | field-list |                                                                                                                                                   |          |                                    |
| integer      | Q1a          | Africa        |            | . > 0 and . < 10 and . != ${Q1b} and . != ${Q1c} and . != ${Q1d} and . != ${Q1e} and . != ${Q1f} and . != ${Q1g} and . != ${Q1h} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1b          | Australia     |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1c} and . != ${Q1d} and . != ${Q1e} and . != ${Q1f} and . != ${Q1g} and . != ${Q1h} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1c          | China         |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1b} and . != ${Q1d} and . != ${Q1e} and . != ${Q1f} and . != ${Q1g} and . != ${Q1h} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1d          | Europe        |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1b} and . != ${Q1c} and . != ${Q1e} and . != ${Q1f} and . != ${Q1g} and . != ${Q1h} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1e          | Far East      |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1b} and . != ${Q1c} and . != ${Q1d} and . != ${Q1f} and . != ${Q1g} and . != ${Q1h} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1f          | India         |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1b} and . != ${Q1c} and . != ${Q1d} and . != ${Q1e} and . != ${Q1g} and . != ${Q1h} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1g          | Middle East   |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1b} and . != ${Q1c} and . != ${Q1d} and . != ${Q1e} and . != ${Q1f} and . != ${Q1h} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1h          | North America |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1b} and . != ${Q1c} and . != ${Q1d} and . != ${Q1e} and . != ${Q1f} and . != ${Q1g} and . != ${Q1i}  | yes      | Each ranking can only be used once |
| integer      | Q1i          | South America |            | . > 0 and . < 10 and . != ${Q1a} and . != ${Q1b} and . != ${Q1c} and . != ${Q1d} and . != ${Q1e} and . != ${Q1f} and . != ${Q1g} and . != ${Q1h}  | yes      | Each ranking can only be used once |
| end group    |              |               |            |                                                                                                                                                   |          |                                    |
+--------------+--------------+---------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------------------------------+

Hi @Natasha_de_Zeeuw

I downloaded you xls file and converted using http://opendatakit.org/xiframe/ and it works well in Collect. Do you use this converter too? if not please try, the only thing you need to change is removing spaces from your xls file.

Regards,
Grzegorz

@Grzesiek2010, I had tested with KoBo because it was convenient. After seeing your message I converted using that link instead and tested, and I ran into the same issues. It doesn't work always as expected.

Got it and I also noticed that when I get the warning (but answers are ok) the problem is solved after changing a device orientation. Looks like a bug in Collect or Javarosa. I'll take a look at it.

2 Likes

Hi again @Natasha_de_Zeeuw and @danbjoseph

I reproduced and analyzed the problem. It's a bug in Collect. I also added my proposed solution.
You can track changes here: https://github.com/opendatakit/collect/issues/2041

As a workaround, for now, I suggest changing your device orientation or for example, opening the navigation view (FormHierarchyActivity) -if you are sure your answers are ok but you can't navigate forward. Then all answers are saved and validated properly.

Regards,
Grzegorz

Thank you, soo much for all the help to everyone!

Thanks for reporting. it's very important and we appreciate it. Collect is huge and it's only a part of ODK so it's not possible to catch everything and that bug is a good example.

1 Like

@Natasha_de_Zeeuw

The issue will be fixed in v1.22.0. The beta version is already available so you can try it.

1 Like