Welcome to the LimeSurvey Community Forum

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

Array (text)--submit this question when they fill in at least one row

  • LisaTW
  • LisaTW's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago #215499 by LisaTW
Hi there,
I try to use array(text) question to ask school travel, there are 4 ways (On foot, by cycling, by public transportation, by car), participant can choose multiple. This is a mandatory question.
But participant needs to fill in all boxes before submit. Could this question change to like this: people could submit this question when they fill in at least one row (like the attached picture).
I'm using Version 3.25.21.

Thank you in advance.

Best,
Lisa
 
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #215514 by tpartner
Question validation equation (given y-scale sub-question codes Y001, Y002...):

Code:
count(self.sq_Y001) == 2
OR
count(self.sq_Y002) == 2
OR
count(self.sq_Y003) == 2
OR
count(self.sq_Y004) == 2

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • LisaTW
  • LisaTW's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago #215535 by LisaTW
Hi Tpartner,

Thank you for your quick reply!
I have tried to add question validation equation but my survey still didn't work. Could you help me check what is wrong in my sample survey?
I want to design this as: participant can choose fill in one row or multiple rows. But my survey still show warning: please complete all parts.

Thank you in advance!

Lisa
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #215542 by holch
I didn't look into your survey, but my guess would be that you have to make the question "non mandatory" and use tpartners code instead to confirm that they filled in at least 1 cell.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • LisaTW
  • LisaTW's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago #215579 by LisaTW
Hi holch,
Thank you for your suggestions! It works well now.
For the question about age, I may used wrong code. so the second question didn't work.
count(S001) == 1
OR
count(S002) == 1
OR
count(S003) == 1
OR
count(S004) == 1
OR
count(S005) == 1
OR
count(S006) == 1
OR
count(S007) == 1
OR
count(S008) == 1

Lisa
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #215582 by tpartner
I suspect the variable names are incorrect. Please read the manual - manual.limesurvey.org/ExpressionScript_-...#Access_to_variables

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose