Check out the LimeSurvey source code on GitHub!

Counting array answers

4 years 1 week ago #92700 by nuin

We have a question where we have an array matrix with 15 subquestions and 12 options (one for each month of the year). We want to have the user to enter an X for at least one month in each one of the subquestions. I tried adding a count validation rule to the whole question, but it does not seem to be working as in our tests you cal leave a whole row empty and the answer is accepted (from a test version of our question)

count(spaq_12_12A_12Jan, spaq_12_12A_12Feb) >= 1 &&
count(spaq_12_12B_12Jan, spaq_12_12B_12Feb) >= 1 &&
count(spaq_12_12C_12Jan, spaq_12_12C_12Feb) >= 1 &&
count(spaq_12_12D_12Jan, spaq_12_12D_12Feb) >= 1

where spaq_12 is the question name 12A, etc is the subquestion ID and 12Jan, etc is the column ID.

Any help appreciated

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form