thank you for trying to understand the problem - but I seem to be pretty poor at explaining the issue.
Right now we have a choice between three provinces in the questionnaire (1,2,3). The list of local institutions we are interested in and are asking questions about (in rosters or in simple single and multiple choice questions) are slightly different for each province. 70% overlap, 30% are different.
We could have designed three questionnaires, one for each province (and I think we should have done this but it is too late now).
But we tried to solve this by filtering the answer options for each province from a master list of all options across the three provinces.
For normal multiple or single choice questions outside rosters your code above helped us to do this via a filter option
e.g. province==2 && ((int?)optioncode).InList(1,3,4,8) || province==3 && ((int?)optioncode).InList(1,2,3,4,5)…
For the rosters this filtering does not work. So we are stuck with creating three rosters, one for each province, with enabling conditions that hide the two rosters not connected to the chosen province.
On the tablet this works fine - but for later data processing (reshaping and merging the rosters into the main STATA database) this is a bit of a nightmare. So one roster per question filtered for the actual province would be better than three rosters per question with enabling condition.
That is about it. But if it requires serious programming and not a simple code I will be unable to accomplish this in the remaining time window and will leave this to the next survey to investigate.