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

More
10 years 5 months 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.
More
10 years 5 months 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.
More
10 years 5 months 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.
More
10 years 5 months 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 - www.limesurvey.org/manual/Expression_Man...onditional_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.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose