Default answers in a multiple short text question: expression refer to equation

More
3 years 4 months ago #118414 by Sev
Sev created the topic: Default answers in a multiple short text question: expression refer to equation
I am using the following system to filter an array question from a (hidden) multiple short text question with default answers, taken from previous equation questions.

Q0. Dual scale question with drop-down
Q11. Equation 1 joins elements from previous question Q0
{if(Q0_SQ001_0=="0","",join(Q0_SQ001_0.shown," and ",Q0_SQ001_1.shown))}
Q12. Equation 2 joins elements from previous question Q0
{if(Q0_SQ002_0=="0","",join(Q0_SQ002_0.shown," and ",Q0_SQ002_1.shown))}
Q13. Equation 3 joins elements from previous question Q0
{if(Q0_SQ003_0=="0","",join(Q0_SQ003_0.shown," and ",Q0_SQ003_1.shown))}
Q2. A multiple short text question using default answers Q11, Q12 and Q13 equations
SQ001
{if(!is_empty(Q11),Q11,’’)}
SQ002
{if(!is_empty(Q12),Q12,’’)}
SQ003
{if(!is_empty(Q13),Q13,’’)}
Q3. An array question for which the previous Q2, multiple short text question, is used as an array filter

My problem stands with question Q2, the expressions to fill in the default answers using EM.
When I run the survey, Q11, Q12 and Q13 can be shown easily in Q2 or Q3's question text or in its sub-questions, using the expression {Q11}. However instead of showing fully, the default answer of Q11 (as well as Q12 and Q13) only shows “and”, the only non-formula/written element of the joint() expression in the equation question Q11.

I actually had succeeded to make it work in a survey I created last year B) but which is now expired. However for some reason (even though the structure seems the same) I cannot make it work this time. :(
I have looked on forums and tried to use different EM expressions with the question code instead, or to write Q11.shown, or to refer to the Q2 sub-question, itself referring to Q11.

I would appreciate any help on the matter.
Thank you!

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #118415 by holch
holch replied the topic: Default answers in a multiple short text question: expression refer to equation
Why don't you get the code from the expired survey and use it in the new survey?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #118417 by Sev
Sev replied the topic: Default answers in a multiple short text question: expression refer to equation
The code I mention is the same one I used in the old survey. The new survey is a copy of the old original one, to which I made some changes. I tried to copy again the same codes, I even re-imported the same question.

Also, whether you move the hidden question to its own question group (between Q1 and Q3) or if it remains just before Q3 does not seem to make a difference. Btw, Q0,Q11,Q12,Q13 are in their own question group (in order to populate Q2, in the subsequent question group).

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #118418 by holch
holch replied the topic: Default answers in a multiple short text question: expression refer to equation
did you check if all the codes are the same after copying the survey? They should, but you never know...

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #118420 by Sev
Sev replied the topic: Default answers in a multiple short text question: expression refer to equation
I have checked each line of each question, and surveys are identical.

Ah! Just found the problem.
I had put the survey setting for Show question index/ allow jumping to "Full" (easier to navigate through long surveys), and that probably blocked links between default answers expression from previous questions.

I changed it "incremental" and now it works!!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!