[ODK Developers] sanity check error when trying to edit saved form

Adding Nathan, as he could perhaps revise XLSForm to detect the presence of
a meta/instanceID field in the survey and not auto-generate one -- he may
want a look at your XLS file.

The problem is that there are two meta/instanceID blocks in your form
(lines 24-29).

There should only be one (namespaces only vaguely respected, and are
clearly ignored when a form is opened to continue editing, causing the
sanity check because there are 2 entries for the same field).


··· On Wed, Feb 13, 2013 at 5:49 PM, wrote:

Hi All:

I have form with several banks of items that the PI has decided are too
long. The solution is to randomly select a couple of items from the banks
of items each time the form is accessed. So, for instance, we ask 2 random
items out of the first bank of 6 items. Later we ask randomly 2 of a bank
of 7 and then 4 out of a bank of 15. Thanks to help from Mitch about 10
days ago I was able to come up w/ an algorithm that does the random
selection just fine. But, if I save the form and then return to Edit it, I
get the error message "sanity check failed." I've seen on the ODK
Community pages that the sanity check error usually indicated a mis-match
between the current XFORM and the saved data. That is clearly not the
problem here as there is just the one form and the error occurs even if you
go right back into the saved form.

I have attached a very minimal version of my form that demonstrates the
problem. In my demo I generate just one random number in the range 1-6.
The 6 items then have a 'relevant' statement testing against the generated
random number.

My original thought was that when I re-accessed the form a new random
number was generated and then as a result there is data in an item that is
not relevant. I can't figure out how to do the randomization only once and
I'm not sure this is really the problem. You'd think that occasionally I'd
generate the correct number and pass the sanity check, but that never

I'm using a Samsung Galaxy Player, 4.2 w/ 8 GB of memory; Android Version
2.3.6; running ODK Collect 1.2.2 (1023).

Thanks in advance for any thoughts you may have.


You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Mitch Sundt
Software Engineer
University of Washington