- Posts: 20
- Thank you received: 0
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
- Topic Author
- Offline
- Junior Member
Less
More
9 years 1 month ago #118351
by privetlm
Indicate whether an answer is blank or not on review page was created 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?
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?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10114
- Thank you received: 3595
9 years 1 month ago #118372
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 Indicate whether an answer is blank or not on review page
1) You should be able to use the is_empty() function:
2) Sorry, I don't understand the question.
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
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 0
9 years 1 month ago #118380
by privetlm
Replied by privetlm on topic Indicate whether an answer is blank or not on review page
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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10114
- Thank you received: 3595
9 years 1 month ago #118381
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 Indicate whether an answer is blank or not on review page
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):
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.