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
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
3 years 2 months ago - 3 years 2 months ago #211884 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:
  1.     install Denis'plugin from: extensions.sondages.pro/questions-updati...column/download.html and enable it in your LimeSurvey installation
  2.     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 is
    Code:
    {is(q1.NAOK=="Y", "Subquestion 2", "")}
    which should result in column 2 disappearing when q1 is answered with Y.

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:
  1. Leave mandatory, add a NA answer, hide (in js) the NA answer line.
  2. Remove mandatory and create an validation equation to replace it …
My conclusions on Denis' advise
  1. 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)
  2. I really would not know how to do this.
Can anyone help?

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
Last edit: 3 years 2 months ago by tammo.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #211889 by DenisChenu
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

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.

Lime-years ahead

Online-surveys for every purse and purpose