I do appreciate support I get here. I posted a question yesterday then upon closer inspection, found out the problem.
My current challenge is the I have a select_one question for previous grade. There are to choices JSS 1 & SSS1.
later down the form, I have another question (current class). I don’t want respondents to make mistake.
So, I want when the respondent chooses JSS1 as previous grade in the earlier select_one question, the class question should automatically be JSS2 (i.e., no need to manually select an answer)
Similarly, if the earlier selected choice is SSS1, I want the form to automatically assign SSS2 as the answer to the class question.
I don’t know if my syntax is wrong but to my understanding, if(${grade}=‘pry6’,‘jss1’,if(${grade}=‘jss3’,‘sss1’)) should be ok for what I want to do but I keep getting error during online form validation.
The error is: Error evaluating field ‘class’ (${enrolment_info}[1]/child_info[1]/class[1]): The problem was located in Calculate expression for ${class} XPath evaluation: cannot handle function ‘if’. Requires 3 arguments but 2 provided. Caused by: org.javarosa.xpath.XPathUnhandledException: The problem was located in Calculate expression for ${class} XPath evaluation: cannot handle function ‘if’. Requires 3 arguments but 2 provided.