Get the answer chosen on the previous question on title of the next question

Mehr
9 Monate 4 Wochen her #163901 von zserban
zserban erstellte das Thema Get the answer chosen on the previous question on title of the next question
Hello,


I am wondering how to deal with this issue:

Q1. (question with multiple answers )From the list below pick ...
1.....
2....
3....
Other

Q2. (question with a single answer, array filter Q1) Which .. .do you use mostly?
1.....
2....
3....
{Q1_other}

Q3. (question with multiple answers) Please choose from the list below the reason for {INSERTANS:...}
...

The problem is I only get the name of 1,2 or 3. If he chooses {Q1_other} it will show just that, Q1_other.

Can I use some IF statement or something in this case? How would you solve this?

Thank you!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
9 Monate 4 Wochen her #163913 von jelo
jelo antwortete auf das Thema: Get the answer chosen on the previous question on title of the next question
If you access the answercode, you'll get the answercode.
The answercode is Q1_other, not the text entered by the respondent.

Try Q1_other.shown. Q1_other should be the same as Q1_other.code
This is quite confusing depending on the question type. There is still room for improvement.

To display Q1.shown or Q1_other.shown needs to be done via a if clause.
{if(Q1.code == 'whatever' OR Q01.code == 'whatever', Q1.shown, Q1_other.shown)}
There are more elegant solutions possible, but a simple approach first cannot be bad.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
Folgende Benutzer bedankten sich: zserban

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
9 Monate 4 Wochen her - 9 Monate 4 Wochen her #163917 von tpartner
tpartner antwortete auf das Thema: Get the answer chosen on the previous question on title of the next question
Here's another IF statement that should work:

{if(!is_empty(Q1_other), Q1_other.shown, Q1.shown)}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Letzte Änderung: 9 Monate 4 Wochen her von tpartner.
Folgende Benutzer bedankten sich: zserban

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
9 Monate 4 Wochen her - 9 Monate 4 Wochen her #163918 von zserban
zserban antwortete auf das Thema: Get the answer chosen on the previous question on title of the next question
tpartner, jelo thank you for your inputs. They were really helpful!


What I did was to rename Q2 other code into other(Q2 had no other option in reality, in was only transferring the other from Q1), and input there the value {Q1_other}.

Then the logic I use in the text of the following questions, which address the user picking on Q3 was this:

if(Q3.NAOK == "other", Q1_other, Q3.shown)

Only if I put Q1_other, I get the text value of Q1_other, which was what I needed, no the expression.
Letzte Änderung: 9 Monate 4 Wochen her von zserban.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
9 Monate 4 Wochen her - 9 Monate 4 Wochen her #163919 von zserban
zserban antwortete auf das Thema: Get the answer chosen on the previous question on title of the next question
Can I complicate things a little bit? :)

I don't want to ask them Q3 if they only select one item on Q2.

But Q4 also needs to have in the title the name of the answer from Q2.

I know I can make a condition on Q3 to only show if the count of responses is bigger than 1.

But, how do I make the logic to get the name of their picking on Q4 considering the above (taking into account the 2 possible cases, 1) user selected more than 1 answer at Q2 and is asked Q3 from which i get the answer; 2) the user isn't asked Q3, and the answer from Q2 is the name I need)?

p.s. Obviously, the logic I use for Q3 to get the name was 'if(Q2.NAOK == "other," Q1_other, Q2.shown)' (not Q3:D)
Letzte Änderung: 9 Monate 4 Wochen her von zserban.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
9 Monate 4 Wochen her - 9 Monate 4 Wochen her #163920 von zserban
zserban antwortete auf das Thema: Get the answer chosen on the previous question on title of the next question
I got this far, or at least that's what I think it might work :)

{if(is_empty(Q3),
if((Q2_other.NAOK == "Y"),
Q1_other,
NO_IDEA_WHAT_TO_PUT_HERE_SINCE_Q1_is_multiple_answer_question),
if(Q2.NAOK == "other",
Q1_other,
Q2.shown)
)
}
Letzte Änderung: 9 Monate 4 Wochen her von zserban.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
9 Monate 4 Wochen her #163926 von zserban
zserban antwortete auf das Thema: Get the answer chosen on the previous question on title of the next question
Hi,

Here is a test survey with my problem, if someone has some time for it. Just in case I'm not very clear, which I know it might be the case.
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha