Constraint on Response

Hi everyone, I am trying to set a constraint on two responses of a second question following the first.

Q1 asks: Is the beneficiary who this survey relates to a male or female? Q1 has two possible responses: male or female.

The second question asks: Who is the survey being applied to? Q2 has two possible responses: Beneficiary or Beneficiary Family Member.

The constraint is for Q2: if the survey relates to a male beneficiary, the respondent must be a beneficiary’s family member. If the survey relates to female beneficiary, the respondent must be the beneficiary themselves. I am trying to constrain the answers such that “Beneficiary” response for Q2 can only be selected if “female” was the response for Q1 and “Beneficiary family member” response for Q2 can only be selected if “male” was the response for Q1. Is there a way to do this?

@cmarin ,

Your explanations seems not clear, if you can share part or section of the questionnaire, it will be fine for proper explanation

@cmarin, maybe you should also be able to do it as outlined in the image shared below:

In the survey tab of your XLSForm:

In the choices tab of your XLSForm:

Image 2

Data entry screen as seen in Enketo:

when a wrong entry is made:

when a correct entry is made:

when a wrong entry is made:

when a correct entry is made:

Reference XLSForm:

constraint.xlsx (13.1 KB)

1 Like