Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How can I control that there is at least one answer per row in an array numbers

  • Acmelive
  • Acmelive's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 4 months ago - 2 years 4 months ago #232134 by Acmelive
Please help us help you and fill where relevant:
Your LimeSurvey version: version 2.06+ Build 150812
Own server or LimeSurvey hosting: Own server
Survey theme/template: Skeletonquest
==================
I have a Array (Numbers) question “P37a” and I want to check that there is at least one answer in each row



For example I choose 4 options out of 11 possible

In Q37a I answer the reasons for choosing the 4 varieties chosen in Q36a

How can I control that there is at least one response per row?

You can test the survey here:
survey.ohpanel.com/index.php/529119?newtest=Y

We have also attached a file with the survey.
Thanks a lot!
Last edit: 2 years 4 months ago by Acmelive.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago - 2 years 4 months ago #232138 by Joffm
Make the question "mandatory".
You see your requirement "at least one answer per row" is exactly what mandatory means in this case (each row is answered)

I do not see any reason to have it "non mandatory" as your previous questions are mandatory.

Otherwise you can use a not complicated, but long "question validation equation".
Like this (either it was not selected in P36a or even not displayed in P36a or the number of answers is greater then 0)
(is_empty(P36a_1.NAOK) or count(self.sq_1.NAOK)>0) and (is_empty(P36a_2.NAOK) or count(self.sq_2.NAOK)>0) and (is_empty(P36a_3.NAOK) or count(self.sq_3.NAOK)>0) and (is_empty(P36a_4.NAOK) or count(self.sq_4.NAOK)>0) and (is_empty(P36a_5.NAOK) or count(self.sq_5.NAOK)>0) and (is_empty(P36a_6.NAOK) or count(self.sq_6.NAOK)>0) and (is_empty(P36a_7.NAOK) or count(self.sq_7.NAOK)>0) and (is_empty(P36a_8.NAOK) or count(self.sq_8.NAOK)>0) and (is_empty(P36a_9.NAOK) or count(self.sq_9.NAOK)>0) and (is_empty(P36a_A.NAOK) or count(self.sq_A.NAOK)>0) and (is_empty(P36a_B.NAOK) or count(self.sq_B.NAOK)>0)

 
  


To be able to use the ".self" variable I changed the codes "10" and "11" to "A" and "B".
Otherwise "self.sq_1" would affect both codes "1", "10" and "11" (all contain a "1").
On the other side you may change the codes to "01", "02", ... "10"
Now "self.sq_01" is different from "self.sq_10"

Furthermore I changed the x-axis codes to "a", "b" , "c" for the same reasons; no interference with "self.sq_1"


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 4 months ago by Joffm.
The following user(s) said Thank You: Acmelive

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago #232163 by holch

2.06+ Build 150812



So you are a panel provider and you are running a over 7 year old version of a survey tool? Your branch of LS isn't supported for several years anymore, and your version isn't even the latest of this branch. I don't think this should be used for collecting data anymore. It hasn't received any bug or security fixes for over 7 years. I highly recommend an update.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: tammo

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose