Require multiple answers of a specific option in an array?

More
5 years 1 month ago #74861 by malberghini
It's my first time trying to use JS in Limesurvey and it's giving me a bit of trouble.

We have an array question with a bunch of subquestions, and three question options. Basically, row after row of A, B or C. We want to default all answers to C, then require them to pick A for a minimum of two subquestions before it will let them continue.

Please Log in to join the conversation.

More
5 years 1 month ago #74882 by Steve01
Hello,

I think one of the easiest solutions might be to wait for the release of LimeSurvey 1.92 (which should be in a couple of days if I'm correct). In LimeSurvey 1.92 there are more possibillities for settings default values and you can use an expression to vaildate a question.

Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team

Please Log in to join the conversation.

More
5 years 1 month ago #74911 by Mazi
Steve, EM won't help much for the requirement of picking answer option A at least twice. This can only be done by coding some customized Javascript. EM can help though when setting default values, but if you have to use JS anyway, these are just 2 more lines of code to set the defaults.

@malberghini, please post a link to an activated sample survey which demonstrates the problem. This way we can have a look at the HTML source.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 1 month ago #74984 by malberghini
Here's the basic survey I have been working on:

www2.isye.gatech.edu/limesurvey/index.php?sid=92454&lang=en

Please Log in to join the conversation.

More
5 years 3 weeks ago #75278 by Mazi
Tony, this maybe you can create some JS magic?


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 3 weeks ago #75282 by TMSWhite

malberghini wrote: Here's the basic survey I have been working on:

www2.isye.gatech.edu/limesurvey/index.php?sid=92454&lang=en


How about re-designing the survey a little bit so that it doesn't require JavaScript?

If you make this a multiple choice question, you could set the min_answers advanced question option to 2 - that way they have to say "Yes" that they want to take at least two classes. Then, you can have an array_filter_exclude-ed question for the classes they did not want to take in which you can ask whether they can or can't take those classes.

You could even use the Ranking style question to let people specify their first and second choices, and still use array_filter_exclude for the second question.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75308 by malberghini
I tried a ranking question followed by a multiple choice using an array_filter_exclude. It never worked. The multiple choice question always came up empty.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75313 by TMSWhite
Here's a working example of using multiple choice and array_filter_exclude: Demo192.limesurvey.org/index.php?sid=69124&newtest=Y&lang=en

The first page shows using multiple choice to select the classes, followed by array_filter_exclude to get feedback on the unselected classes.

The second page tries the same thing with a ranking style question. Ranking and array_filter can work fine, as in this example: Demo192.limesurvey.org/index.php?sid=82898&lang=en

For array_filter_exclude, there is no automatic way to get the names of the unselected classes to display, since their order depends upon the order selected in the ranking question. If we implement sub-question-level relevance in the future, it could control the display; but that is several months away.

So, if you can live with the approach taken on the first page, you can avoid the need for a JavaScript work-around.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75316 by malberghini
I'm getting an error and "We are sorry but you don't have permissions to do this" on both the links.

Please Log in to join the conversation.

More
5 years 3 weeks ago - 5 years 3 weeks ago #75317 by TMSWhite
You have to login at this link first: Demo192.limesurvey.org/admin/admin.php

Details can be found here: www.limesurvey.org/en/Demo
Last Edit: 5 years 3 weeks ago by TMSWhite.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75416 by malberghini
After a bit of testing it seems that these features work in 1.92, but but not 1.91, which is what we are running.

I'm trying to decide between upgrading to 1.92 RC5, using jQuery and 1.91, or worst case, waiting for the 1.92 official.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75476 by Mazi
Version 1.92 already runs quite stable and there will be an official stable release the next 10-14 days I guess.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 3 weeks ago #75504 by tpartner
malberghini, if you can attach a sample survey with the array question I can give you a JavaScript snippet to "default all answers to C, then require them to pick A for a minimum of two subquestions before it will let them continue."

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75549 by malberghini
That would be very much appreciated. Thanks.

www2.isye.gatech.edu/limesurvey/index.ph...54&newtest=Y&lang=en has the basic setup I'm using.

I need to figure out how to use jQuery to set columns in an array in general. I expect as soon as I post this survey, I'll have users asking for buttons that auto select everything in any specific column.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75554 by tpartner
Can you please attach that survey (so I don't have to create it to test).

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.