- Posts: 4
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Limit answers in a dual Array
- danzone
- Topic Author
- Offline
- New Member
Less
More
5 years 4 months ago #177520
by danzone
Limit answers in a dual Array was created by danzone
Dear all, I'm setting up a survey and I need to setup a dual array question (with just an answer for each column), with a contraint: limiting the number of answers to three.
Would I use a simple array, no problem: I could use a validation equation as follow:
But the dual array seems not to have the possibility to specify a validation equation, so maybe the only possible solution is to write some Javascript code.
The kind of question I need to implement is drafted in the attachment.
Should I select another solution/question type?
Would I use a simple array, no problem: I could use a validation equation as follow:
Code:
countifop("==", "A1", OpzioniStrategiche_SQ001, OpzioniStrategiche_SQ002, OpzioniStrategiche_SQ003, OpzioniStrategiche_SQ004, OpzioniStrategiche_SQ005, OpzioniStrategiche_SQ006, OpzioniStrategiche_SQ007, OpzioniStrategiche_SQ008, OpzioniStrategiche_SQ009) <= 3 && countifop("==", "A2", OpzioniStrategiche_SQ001, OpzioniStrategiche_SQ002, OpzioniStrategiche_SQ003, OpzioniStrategiche_SQ004, OpzioniStrategiche_SQ005, OpzioniStrategiche_SQ006, OpzioniStrategiche_SQ007, OpzioniStrategiche_SQ008, OpzioniStrategiche_SQ009)) <= 3
But the dual array seems not to have the possibility to specify a validation equation, so maybe the only possible solution is to write some Javascript code.
The kind of question I need to implement is drafted in the attachment.
Should I select another solution/question type?
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
5 years 4 months ago - 5 years 4 months ago #177525
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Limit answers in a dual Array
How about array-by-column?
- manual.limesurvey.org/Question_type_-_Ar...r_.28array_filter.29
- manual.limesurvey.org/Question_type_-_Ar...r_.28array_filter.29
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 4 months ago by tpartner.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
5 years 4 months ago #177527
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Limit answers in a dual Array
There are already a feture request :
bugs.limesurvey.org/view.php?id=13289
;)
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- danzone
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 1
5 years 4 months ago #177541
by danzone
Replied by danzone on topic Limit answers in a dual Array
OK, I started to monitor it
The topic has been locked.
- danzone
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 1
5 years 4 months ago #177542
by danzone
Replied by danzone on topic Limit answers in a dual Array
Well actually my needs are to have two columns, and possible answers in each column shouldn't be no more than three. It is a "forecast" question: "what do you expect in the next 5 years" and "what do you expect in the next 10 years". I have to admit that I am a Limesurvey newbie Attached a new layout for my question (I realized that the one I posted yesterday doesn't represent my needs correctly).
But maybe I found the way: an Array Number with the checkbox option. I'm going to try this, and I will be back to report whether I succeded or not.
But maybe I found the way: an Array Number with the checkbox option. I'm going to try this, and I will be back to report whether I succeded or not.
Attachments:
The topic has been locked.
- danzone
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 1
5 years 4 months ago #177567
by danzone
Replied by danzone on topic Limit answers in a dual Array
OK, solved it. Array Numbers, with the checkbox option did the job. Attached you can find my solution, in case it would be useful for others.
The validation equation, at sub-question level, is:
The validation equation, at sub-question level, is:
Code:
countifop("==", "1", OpzStrategInnovaz_SQY001_SQX001, OpzStrategInnovaz_SQY002_SQX001, OpzStrategInnovaz_SQY003_SQX001, OpzStrategInnovaz_SQY004_SQX001, OpzStrategInnovaz_SQY005_SQX001, OpzStrategInnovaz_SQY006_SQX001, OpzStrategInnovaz_SQY007_SQX001, OpzStrategInnovaz_SQY008_SQX001, OpzStrategInnovaz_SQY009_SQX001) <= 3 && countifop("==", "1", OpzStrategInnovaz_SQY001_SQX002, OpzStrategInnovaz_SQY002_SQX002, OpzStrategInnovaz_SQY003_SQX002, OpzStrategInnovaz_SQY004_SQX002, OpzStrategInnovaz_SQY005_SQX002, OpzStrategInnovaz_SQY006_SQX002, OpzStrategInnovaz_SQY007_SQX002, OpzStrategInnovaz_SQY008_SQX002, OpzStrategInnovaz_SQY009_SQX002) <= 3
Attachments:
The following user(s) said Thank You: DenisChenu
The topic has been locked.