- Posts: 965
- Thank you received: 218
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Relevance in Array by column: workaround needed
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
3 years 2 months ago - 3 years 2 months ago #211884
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Relevance in Array by column: workaround needed was created by tammo
As it stands currently (using version 3.25.12) the relevance on subquestions in type H (Array by column) does not work.
This is an issue where work is needed, no planning available.
Denis, one of the power users designed a workaround which does almost everything I need, but not all.
My steps:
BUT: since q2 is mandatory, you cannot proceed, because column 2 never gets filled in, because it is not visible.
How to design this?
There is no way for default answers to be set in the user interface for this question. So this needs to be done in Javascript. Denis suggested:
Thank you,
Tammo
PS: since more people might run into this, I have placed it here. Of course I hope that the relevance in Array by Column can be fixed, then we do not need this solution....
This is an issue where work is needed, no planning available.
Denis, one of the power users designed a workaround which does almost everything I need, but not all.
My steps:
- install Denis'plugin from: extensions.sondages.pro/questions-updati...column/download.html and enable it in your LimeSurvey installation
- create a survey with two questions:
q1 is a Y/N questions with question codes also Y/N
q2 is a mandatory Array by column question with two sub-questions.
The text for subquestion 1 is "Subquestion 1" (arbitrary).
The text for subquestion 2 isCode:{is(q1.NAOK=="Y", "Subquestion 2", "")}
BUT: since q2 is mandatory, you cannot proceed, because column 2 never gets filled in, because it is not visible.
How to design this?
There is no way for default answers to be set in the user interface for this question. So this needs to be done in Javascript. Denis suggested:
- Leave mandatory, add a NA answer, hide (in js) the NA answer line.
- Remove mandatory and create an validation equation to replace it …
- If I do this, I have to add an answer option that has as answer option code NA as well as the text for the answer option. I cannot use the setting (on survey level) of "Show no answer" since that only works for non-mandatory questions. But when I add this option as the first option, I do not see a way of prefilling it. Or I have to use Javascript, which I do not have enough knowledge of. I can hide it, that can be done in css (but it might screw up the question logic)
- I really would not know how to do this.
Thank you,
Tammo
PS: since more people might run into this, I have placed it here. Of course I hope that the relevance in Array by Column can be fixed, then we do not need this solution....
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Attachments:
Last edit: 3 years 2 months ago by tammo.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
3 years 2 months ago #211889
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 Relevance in Array by column: workaround needed
For 2 : in
manual.limesurvey.org/Question_type_-_Ar...28em_validation_q.29
!is_empty(Q2_SQ1.NAOK)
AND
(!is_empty(Q2_SQ2.NAOK) OR Q1.NAOK=="Y")
And «You must check {if(Q1.NAOK=="Y","the","both")} column{if(Q1.NAOK!="Y","s")}»
At manual.limesurvey.org/Question_type_-_Ar..._validation_q_tip.29
!is_empty(Q2_SQ1.NAOK)
AND
(!is_empty(Q2_SQ2.NAOK) OR Q1.NAOK=="Y")
And «You must check {if(Q1.NAOK=="Y","the","both")} column{if(Q1.NAOK!="Y","s")}»
At manual.limesurvey.org/Question_type_-_Ar..._validation_q_tip.29
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 following user(s) said Thank You: tammo
The topic has been locked.