- Posts: 967
- Thank you received: 220
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Show the text of a specific answer option with Expression Script
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
2 years 9 months ago #218182
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Show the text of a specific answer option with Expression Script was created by tammo
Use case: setting up a quiz.
Using Radio lists only.
All questions are coded A1, A2, A3 and A4 as answer options, where we repace the answer code of the correct option with a C.
Example (question code is q01):
q01 Which answer is correct?
A1 Wrong Answer 1
C Correct answer
A3 Wrong answer 2
A4 Wrong answer 3
In an evaluation afterwards I would like to show:
Something like: {if(q01!="C", "The correct answer is" q01_C.text, "")}
But I cannot find out how to display the text of the answer option given an answer code. Can anyone point me in the right direction?
Using Radio lists only.
All questions are coded A1, A2, A3 and A4 as answer options, where we repace the answer code of the correct option with a C.
Example (question code is q01):
q01 Which answer is correct?
A1 Wrong Answer 1
C Correct answer
A3 Wrong answer 2
A4 Wrong answer 3
In an evaluation afterwards I would like to show:
- the question {q01.question}
- the given answer {q01.shown}
- and an evaluation {if(q01=="C", "Correct answer", "Wrong answer")}
Something like: {if(q01!="C", "The correct answer is" q01_C.text, "")}
But I cannot find out how to display the text of the answer option given an answer code. Can anyone point me in the right direction?
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
2 years 9 months ago #218185
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 Show the text of a specific answer option with Expression Script
There is no EM variable for the various answer texts, only for the text when answered. I think you will need to hard-code it.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 967
- Thank you received: 220
2 years 9 months ago #218186
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Show the text of a specific answer option with Expression Script
Bummer. I'll write a feature request.
Thanks!
Tammo
Thanks!
Tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 967
- Thank you received: 220
2 years 9 months ago #218187
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Show the text of a specific answer option with Expression Script
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- ritapas
- Offline
- Elite Member
Less
More
- Posts: 213
- Thank you received: 38
2 years 9 months ago #218494
by ritapas
Replied by ritapas on topic Show the text of a specific answer option with Expression Script
I would, where is it?
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
2 years 9 months ago #218498
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Show the text of a specific answer option with Expression Script
Hi Tammo,
When clicking on your link I get this:
When clicking on your link I get this:
APPLICATION ERROR #1100
Issue 17442 not found.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 967
- Thank you received: 220
2 years 9 months ago #218502
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Show the text of a specific answer option with Expression Script
Yes, somehow my feature request was deleted. Don't know why. I made a new one:
bugs.limesurvey.org/view.php?id=17477
Tammo
bugs.limesurvey.org/view.php?id=17477
Tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
2 years 9 months ago #218509
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Show the text of a specific answer option with Expression Script
They didn't like it.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.