- Posts: 15
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Detect if question is answered
- flobau
- Topic Author
- Offline
- New Member
Less
More
5 years 1 week ago #183448
by flobau
Detect if question is answered was created by flobau
Hey,
is there a way i can check if a question has been answered? The intention is to give the user a visual indication when he has completed an answer.
is there a way i can check if a question has been answered? The intention is to give the user a visual indication when he has completed an answer.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13647
- Thank you received: 2491
5 years 1 week ago #183449
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Detect if question is answered
?
Adding a string like this
But more detail can be interesting
manual.limesurvey.org/Expression_Manager
Adding a string like this
Code:
{if(!is_empty(QCODE.NAOK),"<span class='text-danger'>You don't answer</span>","<span class='text-success'>You answer to this question</span>")}
But more detail can be interesting
manual.limesurvey.org/Expression_Manager
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- flobau
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 1 week ago #183450
by flobau
Replied by flobau on topic Detect if question is answered
Thanks for your answer, that's kinda what i want. Where would i put this line, e.g. where do i have access to
?
Code:
QCODE.NAOK
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13647
- Thank you received: 2491
5 years 1 week ago #183451
by DenisChenu
manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming
It's the code of the question …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Detect if question is answered
Where you want it …Where would i put this line
I put a link : read it …where do i have access to
manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming
It's the code of the question …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- flobau
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 1 week ago #183453
by flobau
Replied by flobau on topic Detect if question is answered
Thanks. What if i don't know the question code now and i want it for all question codes?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 1 week ago #183464
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 Detect if question is answered
How would you not know the question codes? You are the survey author.
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: DenisChenu
The topic has been locked.
- flobau
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 1 week ago #183466
by flobau
Replied by flobau on topic Detect if question is answered
Because i don't know yet what survey's i am going to create. I am currently just editing a template, and template are not for a specific surveys i suppose?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 1 week ago #183467
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 Detect if question is answered
The solution supplied by Denis is to be placed in survey question or group text, not in a template.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13647
- Thank you received: 2491
5 years 1 week ago #183471
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Detect if question is answered
For template :
Something like this
in
github.com/LimeSurvey/LimeSurvey/blob/ma..._text_container.twig
for example
See manual.limesurvey.org/Theme_editor
I don't answer to next question if you don't explain more what do you want exactly and what did you try …
Something like this
Code:
{% if(processString("{self.NAOK}") == 0)) %} You don't answer to this question {% endif %}
See manual.limesurvey.org/Theme_editor
I don't answer to next question if you don't explain more what do you want exactly and what did you try …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- flobau
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 1 week ago #183475
by flobau
Replied by flobau on topic Detect if question is answered
Thank you Denis!
I didn't know that you can do that inside a survey question or group text, sorry for that. And sorry for my bad explanation.
I didn't know that you can do that inside a survey question or group text, sorry for that. And sorry for my bad explanation.
The topic has been locked.
- flobau
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 1 day ago #183718
by flobau
I tried this code, but the condition is never true. My goal is to show a visual indication after the user successfully chose a answer from a single choice question - in the moment the user clicks on an answer.
Replied by flobau on topic Detect if question is answered
Code:
{% if(processString("{self.NAOK}") != 0) %} <span>question answered</span> {% endif %}
I tried this code, but the condition is never true. My goal is to show a visual indication after the user successfully chose a answer from a single choice question - in the moment the user clicks on an answer.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 1 day ago - 5 years 1 day ago #183720
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 Detect if question is answered
Try:
Code:
{% if(processString("{!is_empty(self)}")) %}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 1 day ago by tpartner.
The topic has been locked.