Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Indicate whether an answer is blank or not on review page

  • privetlm
  • privetlm's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 2 days ago #118351 by privetlm
I'm dumping all survey questions and answers using this: {qOne.question}: {qOne.shown} .

I'd like to either 1) indicate whether the answer is blank or not. OR 2) color the text of the answer chosen.

Are either one of those (or both) possible? :cheer:
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 day ago #118372 by tpartner
1) You should be able to use the is_empty() function:
Code:
{if(is_empty(qOne), 'EMPTY', qOne.shown)}

2) Sorry, I don't understand the question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: privetlm
The topic has been locked.
  • privetlm
  • privetlm's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 day ago #118380 by privetlm
Thank you! Going off #1, is it possible to only show if it's empty? because of the qOne.shown , it's showing the answer as well as the empty.

2) (apologies for poor/unclear wording) I was wondering if it was possible to color the text of the answer after it's referenced(pulled?) in the review page. like, if qOne.shown then text=green

steps:
-user answer q1.
-reference {qOne.question}: {qOne.shown}
and {qOne.shown} would be green
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 day ago #118381 by tpartner
1) That is an Expression Manager IF function that will only display one of the strings. Please refer to the documentation - manual.limesurvey.org/Expression_Manager#Conditional_Equations

2) You can try something like this but may need to do it without using the editor (the editor may mangle the HTML syntax):
Code:
{if(is_empty(qOne), '<span style="color:red">EMPTY</span>', '<span style="color:green">'+qOne.shown+'</span>')}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose