- Posts: 54
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
update previous question via EM
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
7 years 4 months ago #145764
by Liod_DS
keep improving
update previous question via EM was created by Liod_DS
Hi, i need (for data analisys purpose) to update a previous question with a standard conditioned answer.
here my example:
Group1 (one question for page)
Q1 - Q2 - Q3 - Q4 .... QR
i wrote this code in a Equation type (always hidden) just after QR
{Q4_14 = if(QR.NAOK == 1,'Y',Q4_14.NAOK)}
after i output the values in a boilerplate question with :
check 1 -> {if(D4_14.NAOK == 'Y', "si", "no")}
value - > d4 14 -> {D4_14.NAOK}
but nothing ... even with a simple operator {D4_14= 'Y'}
any hint ?
(i can't attach a survey semples at the moment )
here my example:
Group1 (one question for page)
Q1 - Q2 - Q3 - Q4 .... QR
i wrote this code in a Equation type (always hidden) just after QR
{Q4_14 = if(QR.NAOK == 1,'Y',Q4_14.NAOK)}
after i output the values in a boilerplate question with :
check 1 -> {if(D4_14.NAOK == 'Y', "si", "no")}
value - > d4 14 -> {D4_14.NAOK}
but nothing ... even with a simple operator {D4_14= 'Y'}
any hint ?
(i can't attach a survey semples at the moment )
keep improving
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
7 years 4 months ago - 7 years 4 months ago #145765
by Liod_DS
keep improving
Replied by Liod_DS on topic update previous question via EM
Edit: sometimes Q4 is hidden, depending on Q3 responses
Update:
i think the problem is the relevance ... i have set ((Q3.NAOK != "128")) on the relevance field in Q4...
but how can i hide a question on a different page without using the relevance field ?
Update:
i think the problem is the relevance ... i have set ((Q3.NAOK != "128")) on the relevance field in Q4...
but how can i hide a question on a different page without using the relevance field ?
keep improving
Last edit: 7 years 4 months ago by Liod_DS. Reason: update
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
7 years 4 months ago #145837
by Liod_DS
keep improving
Replied by Liod_DS on topic update previous question via EM
[solved] i used jquery instead of condition to Hide and submit if (cond true) or display the question(if cod false)!
Admin can close this thread, i'll post the code when i fully test the script
Admin can close this thread, i'll post the code when i fully test the script
keep improving
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13647
- Thank you received: 2491
7 years 4 months ago #145845
by DenisChenu
Yes : if relevance of a question is 0 : the question value is set to null.
For hiding question without relevance : currently : javascript. Next version : expression in CSS classes : exemple {if(Q3.NAOK != "128","hidden","")} but only on a different page.
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 update previous question via EM
No need to close , still intersting.Liod_DS wrote: ...
but how can i hide a question on a different page without using the relevance field ?
Yes : if relevance of a question is 0 : the question value is set to null.
For hiding question without relevance : currently : javascript. Next version : expression in CSS classes : exemple {if(Q3.NAOK != "128","hidden","")} but only on a different page.
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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
7 years 4 months ago #145856
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 update previous question via EM
Nice but you'll still need JS to submit the page if in question-by-question mode as Liod_DS is.Next version : expression in CSS classes : exemple {if(Q3.NAOK != "128","hidden","")} but only on a different page.
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.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13647
- Thank you received: 2491
7 years 4 months ago - 7 years 4 months ago #145857
by DenisChenu
See this feature request : bugs.limesurvey.org/view.php?id=9110 from 2014-06-23 2 years ago :blink:
PS : and see the comment : This is easy in PHP (next page) but more development time in same page/javascript.
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 update previous question via EM
Totally right,tpartner wrote: Nice but you'll still need JS to submit the page if in question-by-question mode as Liod_DS is.
See this feature request : bugs.limesurvey.org/view.php?id=9110 from 2014-06-23 2 years ago :blink:
PS : and see the comment : This is easy in PHP (next page) but more development time in same page/javascript.
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: 7 years 4 months ago by DenisChenu. Reason: PS
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
7 years 4 months ago #145900
by Liod_DS
keep improving
Replied by Liod_DS on topic update previous question via EM
Hi there,
Yes JS is still essential to submit the form, but it will do the trick in few lines:
i've hidded the question as first line in the text field:
without the "ready" event to hide it as first (the element was already loaded )
but, with some try and error involved in the process i discoverd the follow:
#1 you can't assign a value of a previous question if the relevance is 0
#2 you can't assign a value of a previous question if the "none of these" option (exclusive) is selected
sorry for the really bad english
Yes JS is still essential to submit the form, but it will do the trick in few lines:
Code:
<script> $(document).ready(function(){ //alert ({D3.NAOK}); if({D3.NAOK} == '128'){ $("#answer722214X474X46825126").click(); //my question is mandatory, but i can't check the "none of these"-exclusive option, otherwise it will deny any future access $("#movenextbtn,#movesubmitbtn").click(); }else{ $("#question46825").toggle(); } }); </script>
i've hidded the question as first line in the text field:
Code:
<script> $("#question46825").toggle(); </script>
without the "ready" event to hide it as first (the element was already loaded )
but, with some try and error involved in the process i discoverd the follow:
#1 you can't assign a value of a previous question if the relevance is 0
#2 you can't assign a value of a previous question if the "none of these" option (exclusive) is selected
sorry for the really bad english
keep improving
The following user(s) said Thank You: DenisChenu
The topic has been locked.