savepartial and onstop are not closing case
Posted: February 17th, 2015, 1:15 pm
Hi -
I have an Android application where location/person identifiers are entered, and then a few questions in there is a question about consent. If consent is not given, then the interview ends and the case is closed. I want to then write logic so that if the interviewer tries to open that case again, they simply get a message saying "consent not given by this household" and an OK button. i.e. I don't want the user to be able to re-open the case if consent is not been previously given.
I've run into various problems trying to do this, and am trying the following:-
1. At the very beginning of the dictionary I've added a protected (ie invisible) item called CONSENT_CLOSE which is set to 0 when data entry starts.
2. If consent is not given then, in the postproc for the consent question, the CONSENT_CLOSED item is set to 1. I then use savepartial and close(0) in the postproc of the consent question to exit the case.
3. If the user tries to re-enter the case they are asked if they want to go to the last position (I don't seem to be able to get around that) and when they say yes (which we always tells interviews to do) they go to the preproc of the consent question (as it was the last position) and if CONSENT_CLOSE = 1 then this does trigger the "no consent message". However, I have savepartial and close(0) in this 'if' clause too, but these don't close the case -instead it stays open. What am I doing wrong?
Any help very gratefully received.
Many thanks
Keith
I have an Android application where location/person identifiers are entered, and then a few questions in there is a question about consent. If consent is not given, then the interview ends and the case is closed. I want to then write logic so that if the interviewer tries to open that case again, they simply get a message saying "consent not given by this household" and an OK button. i.e. I don't want the user to be able to re-open the case if consent is not been previously given.
I've run into various problems trying to do this, and am trying the following:-
1. At the very beginning of the dictionary I've added a protected (ie invisible) item called CONSENT_CLOSE which is set to 0 when data entry starts.
2. If consent is not given then, in the postproc for the consent question, the CONSENT_CLOSED item is set to 1. I then use savepartial and close(0) in the postproc of the consent question to exit the case.
3. If the user tries to re-enter the case they are asked if they want to go to the last position (I don't seem to be able to get around that) and when they say yes (which we always tells interviews to do) they go to the preproc of the consent question (as it was the last position) and if CONSENT_CLOSE = 1 then this does trigger the "no consent message". However, I have savepartial and close(0) in this 'if' clause too, but these don't close the case -instead it stays open. What am I doing wrong?
Any help very gratefully received.
Many thanks
Keith