- Posts: 11
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Display/Call specific list option(s) in other questions
- pietpomp
- Topic Author
- Offline
- New Member
Less
More
10 years 1 month ago #106017
by pietpomp
Display/Call specific list option(s) in other questions was created by pietpomp
Hi all, Q1 has a list of answers A1, A2, A3.
What is the proper syntax to get say A2's text to display elsewhere/in another question.
successfully displays Q1 text
and
successfully shows a selected answer
BUT
I can't get something like
to work. I need it to display the list option whether it was selected or not.
example:
Q1: What is your favourite colour?
Blue
Red
Pink
Q2: Do you sometimes like Red?
Y
N
I've tried
,
,
Thanks
What is the proper syntax to get say A2's text to display elsewhere/in another question.
Code:
{G2Q00001.question}
and
Code:
G2Q00001.shown
BUT
I can't get something like
Code:
{G2Q00001A2.shown}
example:
Q1: What is your favourite colour?
Blue
Red
Pink
Q2: Do you sometimes like Red?
Y
N
I've tried
Code:
{G2Q00001A2.shown}
Code:
{G2Q00001_A2.shown}
Code:
{that.G2Q00001A2.shown}
Thanks
The topic has been locked.
- orvil
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
10 years 1 month ago #106020
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic Display/Call specific list option(s) in other questions
Hallo pietpomp,
I didn't find a way to read the answer options too (assuming you are writing about a radio/list).
So a solution ist to add three questions like
Q2a: Do you sometimes like Blue? Y/N
Q2b: Do you sometimes like Red? Y/N
Q2c: Do you sometimes like Pink? Y/N
with a relevance equation for each of them
Q2a: Q1.shown!='Blue'
Q2b: Q1.shown!='Red'
Q2c: Q1.shown!='Pink'
btw this is the better solution for analysis too, because you have one defined variable for each 'not favourite' color.
Hope this will solve your problem
I didn't find a way to read the answer options too (assuming you are writing about a radio/list).
So a solution ist to add three questions like
Q2a: Do you sometimes like Blue? Y/N
Q2b: Do you sometimes like Red? Y/N
Q2c: Do you sometimes like Pink? Y/N
with a relevance equation for each of them
Q2a: Q1.shown!='Blue'
Q2b: Q1.shown!='Red'
Q2c: Q1.shown!='Pink'
btw this is the better solution for analysis too, because you have one defined variable for each 'not favourite' color.
Hope this will solve your problem
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- pietpomp
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
10 years 1 month ago #106031
by pietpomp
Replied by pietpomp on topic Display/Call specific list option(s) in other questions
thanks orvil, but that wouldn't be practical.
I need to be able to call each 'answer option' anywhere from 10 to 180 times through the survey.
I used a simple example to illustrate the idea of 'calling' a 'variable'. In reality the questions could have up to 35 possible options and What they pick in one question does NOT affect the next questions.
-As for the analysis; each variable as you call it will actually be a range of specific 'answer options' and not just Red or Blue etc.
:huh:
I need to be able to call each 'answer option' anywhere from 10 to 180 times through the survey.
I used a simple example to illustrate the idea of 'calling' a 'variable'. In reality the questions could have up to 35 possible options and What they pick in one question does NOT affect the next questions.
-As for the analysis; each variable as you call it will actually be a range of specific 'answer options' and not just Red or Blue etc.
:huh:
The topic has been locked.
- orvil
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
10 years 1 month ago #106032
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic Display/Call specific list option(s) in other questions
Yes, you are right. For so many questions this would be a nuisance.
An alternative is may be to use a multiple answer question type (checkboxes) and to allow only one answer (using avanced setting). This question type allows to adress the answer text.
Another alternative is may be to create a hidden question (eg. short text array) in front with default answers and to adress already the option text in your Q1 exampel by an EM expression as well as the following questions.
May be you can provide a more detailed or longer example, that i can get a glue?
An alternative is may be to use a multiple answer question type (checkboxes) and to allow only one answer (using avanced setting). This question type allows to adress the answer text.
Another alternative is may be to create a hidden question (eg. short text array) in front with default answers and to adress already the option text in your Q1 exampel by an EM expression as well as the following questions.
May be you can provide a more detailed or longer example, that i can get a glue?
Best regards/Beste Grüße,
O. Villani
The following user(s) said Thank You: pietpomp
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
10 years 1 month ago #106034
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 Display/Call specific list option(s) in other questions
It seems that Expression Manager only gives you direct access to the text for questions and sub-questions, not to answer text.
However, I don't understand why you need it. Piping text is usually used to dynamically modify text but your answer text strings are static.
.
However, I don't understand why you need it. Piping text is usually used to dynamically modify text but your answer text strings are static.
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- pietpomp
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
10 years 1 month ago - 10 years 1 month ago #106061
by pietpomp
Replied by pietpomp on topic Display/Call specific list option(s) in other questions
Thanks orvil, Your second suggestion is pretty much where I ended up. So ATM I'm looking at different EM approaches in order to resolve the call efficiently.
tpartner, your are correct re the static strings, that is the dilemma.
--> Why, I have a very specific and complex survey project, but I'll use a simple example. Say I put together a survey that calls certain q's re product A. Next week {or next participant for that matter} I want to ask the same questions, but for product B. I hop in, swap out 'static string variable value' with product B and we're all set to use the same survey. ~ in reality I'll do this now by assigning text according to triggered <random> value and that in turn will set up a list of question for either product A or B.
Like: "do you like cheese?" next guy gets "do you like butter?" but, both had a question "do you like cheese, butter or milk?"
tpartner, your are correct re the static strings, that is the dilemma.
--> Why, I have a very specific and complex survey project, but I'll use a simple example. Say I put together a survey that calls certain q's re product A. Next week {or next participant for that matter} I want to ask the same questions, but for product B. I hop in, swap out 'static string variable value' with product B and we're all set to use the same survey. ~ in reality I'll do this now by assigning text according to triggered <random> value and that in turn will set up a list of question for either product A or B.
Like: "do you like cheese?" next guy gets "do you like butter?" but, both had a question "do you like cheese, butter or milk?"
Last edit: 10 years 1 month ago by pietpomp.
The topic has been locked.
- orvil
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
10 years 1 month ago #106064
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic Display/Call specific list option(s) in other questions
hi pietpomp,
funny thing, I have had to solve a similar challenge: a survey of constant structure with varying objects to rate.
setting up a new survey every time does not seem to be very handy. So I'm using a hidden text anwer in front, filling it via the default answer option. This can be changed even if the survey is running.
The side effect is that one has to postprocess the resulting answer database because of fields filled with different measurements.
funny thing, I have had to solve a similar challenge: a survey of constant structure with varying objects to rate.
setting up a new survey every time does not seem to be very handy. So I'm using a hidden text anwer in front, filling it via the default answer option. This can be changed even if the survey is running.
The side effect is that one has to postprocess the resulting answer database because of fields filled with different measurements.
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
10 years 1 month ago #106066
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 Display/Call specific list option(s) in other questions
Yes, I would be inclined to use hidden equation questions to contain the strings and then use Expression Manager to pipe them where necessary.
.
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
10 years 1 month ago #106067
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 Display/Call specific list option(s) in other questions
...or token attributes if using tokens...
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- pietpomp
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
10 years 1 month ago #106103
by pietpomp
Replied by pietpomp on topic Display/Call specific list option(s) in other questions
So that seems the better approach ATM, thanks guys.
FYI I found that the 'global' label set thingy comes in very handy. It does not update automatically, but you can trigger updates per questions if the 'label'/option answers ever change.
For the data orvil, I was thinking of making the answer ladel codes a bit more indigative, so that 1. it should read sensible, and 2. I could be married up to other 'system names' for each variable set (import data)
tpartner, now I'm looking at the EM to present different survey compositions on a random basis. So it's starting to come together now.
FYI I found that the 'global' label set thingy comes in very handy. It does not update automatically, but you can trigger updates per questions if the 'label'/option answers ever change.
For the data orvil, I was thinking of making the answer ladel codes a bit more indigative, so that 1. it should read sensible, and 2. I could be married up to other 'system names' for each variable set (import data)
tpartner, now I'm looking at the EM to present different survey compositions on a random basis. So it's starting to come together now.
The topic has been locked.