Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Is there a way to force a skipped question to store default value in response DB

More
4 hours 11 minutes ago #273645 by rwinford77
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Version 6.16.2+251209 
Own server or LimeSurvey hosting:  own
Survey theme/template:  bootstrap vanilla (with some color mods)
==================

Hello LimeSurvey community.  thanks for all the help in the past.  I understand all of you are volunteers and I greatly appreciate your help.  

I am trying to use values from the participation token file to reduce the amount of typing the participants have to do.  I can successfully retrieve the TOKEN attribute data and display to the user.  It is information that they entered previously, such as their region or area. I set the default answer for the questions from the TOKEN attributes.  I show them the data and then have a check-box asking if they need to update the data.  If the check-box (multiple choice with one possible answer) is checked, I show the questions to update the personal data.  If the box is NOT checked, I do not display the questions (relevance 0).  If the personal info questions are NOT shown, then nothing is stored in the response DB, even though there was a default answer set.  

I have created a work-around by creating a hidden equation question at the end that sets the value: 
Code:
(if(is_empty(Q00.NAOK), TOKEN:ATTRIBUTE_1, Q00.NAOK)}]

Is there a way to "force" LS to save the response of a non-displayed question (relevance 0) to be the default value?

I've attached a simple LSS file that I believe shows the issue.

thanks,
Rick
 

Please Log in to join the conversation.

More
3 hours 21 minutes ago #273647 by Joffm
Hi,
well, this is the desired and expected behaviour.
If a question is skipped, there is a reason for this. So the question is emptied.
Possible scenario:
The respondent clicks "My car is a Honda" and he is asked some questions about "Honda"
Then he realises that there was a mistake. He wanted to click "Hyundai". So he returns to this page and changes the selection to "Hyundai".
Of course his answers to the "Honda" questions have to be removed.

Now your scenario:
I remember that some years ago I showed something about this.
But anyway: You should revise this workflow.
I'd simply show the text and in the question I'd say "These are the informations you entered in the previous wave. If there are any changes, please enter ".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
3 hours 16 minutes ago #273648 by rwinford77
Hi Joffm, thanks for the quick reply.

That's actually what I do: I show the users the previous answers and ask if they need/want to update. If they say no (not check the box) then the survey assumes the same answers and does not show the questions. But, then there are no answers in the response file for those questions.

Rick

Please Log in to join the conversation.

More
2 hours 40 minutes ago #273651 by Joffm
Yes, I know.
And in my opinion this is an unnecessary doubling.
Therefore, either
1. use a simple text question (as I said before)
2. use an array(text) with two columns (one with the text, one to indicate the need to change); some JavaScript needed.
3. You may hide the question by JavaScript.

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
2 hours 24 minutes ago - 2 hours 23 minutes ago #273652 by rwinford77
Thanks again for your quick response; I do appreciate it.

I was hoping for a different answer, but I understand the need to keep answers empty if the question is not shown. My personal info answer is 4 different questions of different types (text, multiple-choice, and list-dropdown). So, I will use my current workaround: I have created 4 hidden equation questions at the end: if Q is empty, use token:attribute, else use Q. Then, that equation Q answer is stored in the response and I will use that in post processing.

thanks again.
Last edit: 2 hours 23 minutes ago by rwinford77.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose