Randomization - Generation in Reopening Forms


(Alicea Cock-Esteb) #1

Hello,

I am using a Commcare-based survey in which several questions involve randomly selected scenarios: several random numbers are generated to assign a scenario, and then the following questions depend on the assigned scenario.

We have observed that when we exit the app and then reopen a specific form later, the scenario number is different from the first time (i.e. Commcare re-does the randomization and therefore assigns a different scenario). This is a problem because the previously-saved answers no longer correspond to
the questions that appear on the screen.

My colleague Caroline posted this very same issue in 2017 and we are starting a new survey and facing the same issue. In the past we were able to work around it, but this current one doesn’t have a good work around. We would like to avoid setting up cases. Will Pride had suggested there is a way to avoid this using custom XML. It looks like he no longer is with Dimagi. Is there anyone else that could help me with this?

Thanks in advance,
Alicea


(Clayton Sims) #2

Hi Alice,

When you mention re-opening a specific form, are you referring to using the “Incomplete forms” feature to save the state of a form and restart it at a later time?

If so, I believe that shifting any calls for the random() function into a Default Value instead of into a Calculation will prevent them from recalculating in the event of an incomplete form being reloaded.

-Clayton