Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Can I repeat a group of questions conditionally?

Can I repeat a group of questions conditionally? 2 years 8 months ago #70990

  • jsmello
  • jsmello's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 32
  • Karma: 0
Hi,

I would like to know if I can repeat a group of questions depending on a information given before.

For example, the user enters with a (variable) set of products. And after I need of the informations about each previous product.

So In this case, I will have a dynamic survey.

Is it possible?
Thanks,
Jefferson.
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 8 months ago #71046

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Jefferson-

If you can use array_filter, that is easiest, and you can do it in 1.91+. If you know the products you're asking about, you can have subjects click which they use, then have follow-up questions that use array_filter to just show follow-up questions relevant to the selected products.

If you need to ask questions that can't be array filtered, here is how you could do that in 1.92RC1:

Say you use a multiple short text question type to let people enter the product names. Let's call this question "Products", and the codes for them #s A-Z

Then, say you have 5 follow-up questions about each product. Let's call them FU_A1, FU_A2, ..., FU_A5
...
FU_Z1, ... FU_Z5

The easiest way is to put the 5 follow-up questions in its own group. That way you can export the group, re-import it, and change the question names quickly and easily.

Soon, you'll be able to use group-level relevance. So, for the group, use a Relevance equation like
{!is_empty(Product_A)}

for group FU_A (which contains questions FU_A1 - FU_A5).

For now, however, you need to assign relevance to each question within the group. So, you'd put the same equation for questions FU_A1 - FU_A5.

When you run the survey, groups that have no relevant questions are completely skipped.

I'd also recommend running with the Question Index on. That way, if people want to go back and change lists of products, they can click back to the end, then click on a later question, and LimeSurvey will ensure that any newly mandatory questions are asked (and that any newly irrelevant questions are NULLed out).

/Tom
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 8 months ago #71247

  • jsmello
  • jsmello's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 32
  • Karma: 0
Thanks Tom.

I have two questions.

In this part: " The easiest way is to put the 5 follow-up questions in its own group. That way you can export the group, re-import it, and change the question names quickly and easily. "
Maybe, I do not get it right.
In the first group of questions the user will enter the names of the products and, for each product, I will repeat the other group of question.
In my case, only the title of the group of questions will be change. Will I get do that in this solution?

the second is:

I am afraid to update my limesurvey. Are there some problem in the update process?

Thanks,
Jefferson.
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 8 months ago #71248

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Jefferson-

If you have a live survey site, I'd recommend testing the update process on a copy of the site rather than the live site. Also, if you're interested in 1.92 RC1, remember that it is not recommended for production use yet.

You are correct that your list of products will be the same (the text of the question). However, the question code needs to be changed in each group. So, if you have follow-up question A-Z, group A would have question codes FU_A1-FU_A5, group B would have question codes FU_B1-FU-B5, etc.

/Tom
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 7 months ago #71847

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5324
  • Thank you received: 294
  • Karma: 249
You can't repeat a number of questions dynamically because the table for holding answer data is fixed once you activate a survey.
A solution though is to create a sufficient number of follow up questions e.g. one group of X questions for each car/product/... and then use conditions to show the accoridng number of follow up questions.
For this to work, set the condition for the first question and then copy it to ALL following question of the same group if there are several follow up questions for one item.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 7 months ago #71861

  • jsmello
  • jsmello's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 32
  • Karma: 0
Hi Mazi and TMS,

I was doing other things and today I will try to make the solution given by TMS.
My idea is to repeat the group of questions and to use the group question relevance to show/hide them based on the number of products inserted before (note that the maximum number of products should be fixed).

Futhermore, the group questions relevance is only available in a Release Candidate version.

Your solution seems to be more easier than other. However, the group of questions could stay very extensive depending on the number of questions. Probably I will use it.

Thanks Tom and Mazi.
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 7 months ago #71863

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5324
  • Thank you received: 294
  • Karma: 249
You're welcome!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 7 months ago #71958

  • jsmello
  • jsmello's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 32
  • Karma: 0
Hi,

I made a solution using only one group of questions. That was reasonable, but depending on the number of questions by each product, the page could be very "heavy" to the user.

So I thought and I realized that I can implement something like the "group of questions relevance" using JavaScript code. For instance, I create 5 group of questions, where 5 is the maximum number of products. Thus, in each group of questions I put some javascript code that verify if that group of question should appear or not.

I would like to know how can I reference the title of a group of question? Because I will change it dynamically by javascript code.

ps: As soon as possible I activate the survey to you take a look. It is in portuguese hehhehhe

Att,
Jefferson Mello.
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 7 months ago #71959

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
jsmello-

group-level relevance is working well in 1.92 RC2 - please give that a try if you get a chance. It might be easier than the javascript solution.

To answer your question, {GROUP_DESCRIPTION} is the title of the group.

/Tom
The administrator has disabled public write access.

Re: Can I repeat a group of questions conditionally? 2 years 7 months ago #72008

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5324
  • Thank you received: 294
  • Karma: 249
I don't think that the Javscript solution is the best way to go. I would copy the groups using export/import and then use conditions as described above.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.210 seconds
Donation Image