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
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 9 months ago #218182 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:
  • the question {q01.question}
  • the given answer {q01.shown}
  • and an evaluation {if(q01=="C", "Correct answer", "Wrong answer")}
And when the answer given by the user was wrong I want to show what the correct answer was.

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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #218185 by tpartner
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
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 9 months ago #218186 by tammo
Bummer. I'll write a feature request.

Thanks!

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 9 months ago #218187 by tammo
bugs.limesurvey.org/view.php?id=17442

Feel free to support this feature request. ;-)

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
2 years 9 months ago #218494 by ritapas
I would, where is it?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #218498 by holch
Hi Tammo,

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
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 9 months ago #218502 by tammo
Yes, somehow my feature request was deleted. Don't know why. I made a new one:
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
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #218509 by holch
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.

Lime-years ahead

Online-surveys for every purse and purpose