- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Default answer not picking update a previous answers
- C123
- Topic Author
- Offline
- New Member
Less
More
6 years 11 months ago #151836
by C123
Default answer not picking update a previous answers was created by C123
I have a question that has a default answer that depends on the answer given earlier in the survey. However, this does not pull through. Here is the statement I'm using;
if(is_empty(DP1Q1), 'This question has not been answered', 'This question has been answered')
The odd thing is if I put the same statement in the question body it pulls through correctly. So the question body says that they have answered the question and the default answer says that they have not. Does anybody have any ideas?
Thanks in advance.
if(is_empty(DP1Q1), 'This question has not been answered', 'This question has been answered')
The odd thing is if I put the same statement in the question body it pulls through correctly. So the question body says that they have answered the question and the default answer says that they have not. Does anybody have any ideas?
Thanks in advance.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
6 years 11 months ago #151842
by jelo
Assigning a Textstring "This question has not been answered" as a value for a default answer seems not correct.Most common would be an answer or questioncode, but not a written text.
manual.limesurvey.org/Expression_Manager#Access_to_Variables
Export these two questions as a survey and attach it here.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Default answer not picking update a previous answers
What questiontype should be assigned a default answer.C123 wrote: I have a question that has a default answer that depends on the answer given earlier in the survey.
Assigning a Textstring "This question has not been answered" as a value for a default answer seems not correct.Most common would be an answer or questioncode, but not a written text.
manual.limesurvey.org/Expression_Manager#Access_to_Variables
Export these two questions as a survey and attach it here.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- C123
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
6 years 11 months ago - 6 years 11 months ago #151844
by C123
Replied by C123 on topic Default answer not picking update a previous answers
Hi
Thanks for reading I've attached the two questions.
It is a work in progress and the text will be different once it finished, I'm just trying to get the basic mechanics working at the moment.
I did try using question codes but I get a similar error where the default answer is blank but if I use the code in the question body it works.
Thanks for reading I've attached the two questions.
It is a work in progress and the text will be different once it finished, I'm just trying to get the basic mechanics working at the moment.
I did try using question codes but I get a similar error where the default answer is blank but if I use the code in the question body it works.
Attachments:
Last edit: 6 years 11 months ago by C123. Reason: Wrong file
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
6 years 11 months ago #151855
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Default answer not picking update a previous answers
What version of LimeSurvey is used? Since you use a textfield you can assign text the way you do it.
It's working. I only edited the textfield, but didn't change anything. The DP1Q1 is your post was DP1Q100 in your export. So no change by me. Perhaps you try again and check every variable. Perhaps you fixed it already.
Code:
{if(is_empty(DP1Q100),'This question has not been answered','This question has been answered')}
It's working. I only edited the textfield, but didn't change anything. The DP1Q1 is your post was DP1Q100 in your export. So no change by me. Perhaps you try again and check every variable. Perhaps you fixed it already.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Attachments:
The topic has been locked.
- C123
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
6 years 11 months ago #151857
by C123
Replied by C123 on topic Default answer not picking update a previous answers
Attachments:
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
6 years 11 months ago #151866
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Default answer not picking update a previous answers
That is no error, the default answer will not change dynamically once you got the answer shown.
You might consider placing the answer on another page. That might will update the default answer.
You might consider placing the answer on another page. That might will update the default answer.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- C123
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
6 years 11 months ago #151869
by C123
Replied by C123 on topic Default answer not picking update a previous answers
I should have mentioned that they these are in different groups it is set to show a group a page. However, I have got full jumping turned on would that make a difference?
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
6 years 11 months ago #151873
by jelo
The default answer can only be set once, when the question is displayed.
Best approach using Limesurvey is using Group by Group mode.
Place the question in one group and the text question with the default answer expression in the next group. The default answer will be shown correctly.
If not, export a survey structure instead of single questions files.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Default answer not picking update a previous answers
Fulljumping? I don't understand.C123 wrote: However, I have got full jumping turned on would that make a difference?
The default answer can only be set once, when the question is displayed.
Best approach using Limesurvey is using Group by Group mode.
Place the question in one group and the text question with the default answer expression in the next group. The default answer will be shown correctly.
If not, export a survey structure instead of single questions files.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: C123
The topic has been locked.
- C123
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
6 years 11 months ago #151889
by C123
Replied by C123 on topic Default answer not picking update a previous answers
Thanks, for your help I think I understand now, even though I'm using the group by group mode because I've got full navigation turned on once the group with the default answer group is visited it won't change even if the user goes back and changes the other answer.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
6 years 11 months ago #151900
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 Default answer not picking update a previous answers
It sounds to me that in order to have this dynamic, rather than using the default answer setting, you should be using an equation question with the Expression Manager assignment operator to set the question.
Some notes:
1) The equation question is best placed in a group following that of the question to be manipulated.
2) The equation question must be place in a group that will always be seen (not skipped via relevance).
manual.limesurvey.org/Expression_Manager#Operators
Some notes:
1) The equation question is best placed in a group following that of the question to be manipulated.
2) The equation question must be place in a group that will always be seen (not skipped via relevance).
manual.limesurvey.org/Expression_Manager#Operators
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
6 years 11 months ago #151906
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Default answer not picking update a previous answers
Correct, that is intended behavior (at least it works like this since default answers were introduced). Post a small export of two groups here. We can try the assignment as tpartner suggested.C123 wrote: it won't change even if the user goes back and changes the other answer.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.