Welcome to the LimeSurvey Community Forum

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

Autopunch answers

More
10 years 10 months ago #104529 by dknvs
Autopunch answers was created by dknvs
I would like to know how can I autopunch the answers for limesurvey when piping into another question.

Here is an example to illustrate:

Q1 is a multiple select question.
What did you buy at the grocery store?
-meat
-fruit
-cheese
-vegetables

Q2 is a single select(radio) question
Which one is the most expensive grocery that you bought?

I would like to pipe what I selected in Q1 into this question. But since Q1 is a multiple select question, I want people who select only ONE option from Q1 to skip Q2. But this person's answer will be autopunched in Q2.

For example, respondent A choose only "meat" from Q1. I want to autopunch "meat" in Q2 for this respondent without them seeing Q2.

It will be great if someone can help me out with this issue.

thanks
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 10 months ago - 10 years 10 months ago #104534 by Mazi
Replied by Mazi on topic Autopunch answers
Check the array filter feature, it does exactly what you are talking about: www.limesurvey.org/manual/Question_type_...r_.28array_filter.29

Best regards/Beste Grüße,
Dr. Marcel Minke
Last edit: 10 years 10 months ago by Mazi.
The following user(s) said Thank You: dknvs
The topic has been locked.
More
10 years 10 months ago #104620 by dknvs
Replied by dknvs on topic Autopunch answers
Hi,

I really appreciate your response.
I wasn't being very clear in my question.
I understand how to do array filter to only shows the options that piped from the previous questions.
What I don't understand is that if respondents only choose one option from Q1, it won't make sense for respondents to see Q2 (because Q2 is asking the most expensive grocery).
I would like respondents who only choose ONE OPTION(e.g., meat) from Q1 can skip Q2, BUT their answers (meat) for Q2 is automatically filled in the data.

hope this make sense...

thank you
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 10 months ago #104649 by Mazi
Replied by Mazi on topic Autopunch answers
That of course makes sense but such a feature doesn't exist at Limesurvey.

Instead, you can show Q2 only if >1 answers were given at the previous question. Use this relevance equation:
count(q1_1, q1_2, ...)>1

where q1 ist the question code and 1, 2, ... n are the subquestion codes of q1.

Best regards/Beste Grüße,
Dr. Marcel Minke
The following user(s) said Thank You: dknvs
The topic has been locked.
More
10 years 10 months ago #104723 by dknvs
Replied by dknvs on topic Autopunch answers
so this equation will let respondents skip Q2 (if they only choose 1 answer). However, it won't autopunch the data for Q2?

"I would like respondents who only choose ONE OPTION(e.g., meat) from Q1 can skip Q2, BUT their answers (meat) for Q2 is automatically filled in the data."
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 10 months ago #104727 by tpartner
Replied by tpartner on topic Autopunch answers
Well, if both questions are on the same page, you could do that with JavaScript but I don't understand why you need it. If only one option is checked in Q1, don't you already know the answer to Q2?


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
10 years 10 months ago #104729 by dknvs
Replied by dknvs on topic Autopunch answers
These two questions will be in separate page.
Could you please tell me how to do it with JavaScript?
You are right, we will know the answer to Q2 if only one option is checked in Q1. That's why it doesn't make sense for them to see Q2. But for the convenience of analyzing the data, we will want that data to be auto filled in for Q2.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 10 months ago - 10 years 10 months ago #104730 by tpartner
Replied by tpartner on topic Autopunch answers
As I said, "if both questions are on the same page, you could do that with JavaScript".

It is possible if the questions are on separate pages but gets very complicated and is probably too much work for "convenience of analyzing".

Regarding "That's why it doesn't make sense for them to see Q2", you can use Mazi's method of hiding the question.


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 10 months ago by tpartner.
The topic has been locked.
More
10 years 10 months ago #104734 by david2013
Replied by david2013 on topic Autopunch answers
I guess you can do it in two ways:
1) At Q2, use jQuery to check number of answers in Q1, if more than 1, do nothing; if just one answer, use jQuery to select the answer, then submit the form automatically. The only disadvantage is that survey taker will see flash of Q2.

2) Never try it before. But may be you can try it. Assuming you have Q3 and everyone need to answer it. At Q3, check number of answers in Q1, if more than 1, do nothing; if just one answer, you can use jQuery to insert a hidden field which contains answer of Q2. Also, at Q2, you can use Mazi's method to hide the question.

I also hoping Limesurvey can do autopunching. I remember when I was working for data collection company, we have data department to check the data. If programmers forgot to do the autopunching, they always screaming like 3 yrs kid.

Thanks,
David
The following user(s) said Thank You: dknvs
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 10 months ago #104745 by Mazi
Replied by Mazi on topic Autopunch answers
If you really need that auto punching, create either a text question and use an EM expression for filling it with the one answer selected at Q1
OR
create X (X = number of answer options at Q1) follow up list radio question, each with a different default answer and being filled only if at Q1 one answer was given.

The later might be tricky because you need to hide the questions using JS so the default answer gets populated. I didn't test this yet.

Best regards/Beste Grüße,
Dr. Marcel Minke
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose