- Posts: 10103
- Thank you received: 3591
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Detect if question is answered
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
4 years 11 months ago #183828
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
Nice!
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- flobau
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
4 years 11 months ago - 4 years 11 months ago #183880
by flobau
Replied by flobau on topic Detect if question is answered
Thanks for your answers guys! I tried Denis's solution, but
stays always 0 for me. I used the exact same code as you in my template.
Here you can see, that self.NAOK is always 0, even when i answered the question.
Code:
count(self.NAOK)
Code:
{% set questionCount = processString("{count(self.question)}") %} count(self.question): {{ questionCount }} <br> count(self.NAOK): {{ processString("{count(self.NAOK)}") }} <br> {{ processString("{if(count(self.NAOK) == 0,'<span class=\"text-danger\">No question answered</span>')}") }} {{ processString("{if(count(self.NAOK) gt 0 and count(self.NAOK) lt "~questionCount~",'<span class=\"text-warning\">'+count(self.NAOK)+' question(s) answered</span>')}") }}
Here you can see, that self.NAOK is always 0, even when i answered the question.
Last edit: 4 years 11 months ago by flobau.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13624
- Thank you received: 2490
4 years 11 months ago #183881
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
Maybe a js issue, but you don't tell : LimeSurvey version and build number, if you use vanilla theme without ajax mode etc …
I can track down your issue and help you more.
I can track down your issue and help you more.
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
4 years 11 months ago - 4 years 11 months ago #183882
by flobau
Replied by flobau on topic Detect if question is answered
We are using LimeSurvey Version 3.17.0. I don't know where to find the build number.
The theme is extended from vanilla theme.
edit: Ajax Mode is on.
The theme is extended from vanilla theme.
edit: Ajax Mode is on.
Last edit: 4 years 11 months ago by flobau.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
4 years 11 months ago #183885
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
ALWAYS disable AJAX. In my opinion, it does nothing other than cause problems.Ajax Mode is on.
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: 13624
- Thank you received: 2490
4 years 11 months ago - 4 years 11 months ago #183887
by DenisChenu
But possible other issue
1. Difference between 3.17.0 and 3.17.2, i don't think but …
2. Another issue in the survey that broke javascript.
EDIT : with or witout ajax mode : it don't work when reload or try to submit
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
Here, it seems to work with ajax on .tpartner wrote:
ALWAYS disable AJAX. In my opinion, it does nothing other than cause problems.Ajax Mode is on.
But possible other issue
1. Difference between 3.17.0 and 3.17.2, i don't think but …
2. Another issue in the survey that broke javascript.
EDIT : with or witout ajax mode : it don't work when reload or try to submit
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.
Last edit: 4 years 11 months ago by DenisChenu. Reason: EDIT
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13624
- Thank you received: 2490
4 years 11 months ago #184012
by DenisChenu
Since self.question seems broken when reload : JS .question broken, then using it as static var.
Proof of concept (i deactivate setCustomValidty) : demo.sondages.me/483539 .
After : some other need to be done
- Other is inside .question but are not always mandatory.
- Array filter : maybe using .relevanceStatus and not .question can fix this issue ? Unsure what happen for _other.relevanceStatus and _comment.relevanceStatus
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
Git it,DenisChenu wrote:
EDIT : with or witout ajax mode : it don't work when reload or try to submit
Since self.question seems broken when reload : JS .question broken, then using it as static var.
Code:
{% set questionCount = processString("{count(self.question)}",1,1) %}
Proof of concept (i deactivate setCustomValidty) : demo.sondages.me/483539 .
After : some other need to be done
- Other is inside .question but are not always mandatory.
- Array filter : maybe using .relevanceStatus and not .question can fix this issue ? Unsure what happen for _other.relevanceStatus and _comment.relevanceStatus
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.