Welcome to the LimeSurvey Community Forum

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

Array filter with exclusive option

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #48364 by DenisChenu
Replied by DenisChenu on topic Array filter with exclusive option
Just an idea :

Add the None of the above answer to each question, put this one in default for the first question and hide it with css/js.

I think it's easy to do, there are only a problem : all first statistics are bad cause this option.

:)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #48374 by tpartner
Replied by tpartner on topic Array filter with exclusive option

Add the None of the above answer to each question, put this one in default for the first question and hide it with css/js.

Clever idea Shnoulle but I'm struggling with the lack of a click event not firing the filtering function. How would you set the "default" in Q1?

Dawna, I don't suppose these questions are on separate pages are they?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • wireframemedia
  • wireframemedia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #48376 by wireframemedia
Replied by wireframemedia on topic Array filter with exclusive option
Hi Tony,

Yes they are each on a separate page. The survey is question-by-question.

I went back to the client and asked if we could add this option to each of the previous questions so it would be there when it was needed to filter through. I'm still waiting on an answer but I fear they will want to keep it as is. :-(

Thanks.
Dawna
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
13 years 6 months ago #48383 by Mazi
Replied by Mazi on topic Array filter with exclusive option
tpartner wrote:

Clever idea Shnoulle but I'm struggling with the lack of a click event not firing the filtering function. How would you set the "default" in Q1?

Can't we do that by using the new default answer feature in Limesurvey. If you set a default answer there it should check the box at loading time; this should also work if the option is hidden by CSS I guess.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #48392 by tpartner
Replied by tpartner on topic Array filter with exclusive option
Duh...zoned on that!

So if Dawna can beat her customer into allowing hidden "none of the above" options in all questions we can do it this way.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • wireframemedia
  • wireframemedia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #48393 by wireframemedia
Replied by wireframemedia on topic Array filter with exclusive option
By setting that up as a default answer that will upset the skip logic as in some places checking that off, terminates the user.

Is there any other way to add in a static, exclusive option along with a filtered array?

I really need this to work for 2 questions then I'm all set.

Thanks.
d.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #48397 by tpartner
Replied by tpartner on topic Array filter with exclusive option
Darn, that kind of sets us back to JavaScript.

Well I can force the "none of the above" option to appear but if the respondent checks it, advances in the survey and then returns, the option will be unchecked by the filtering process.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • wireframemedia
  • wireframemedia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #48399 by wireframemedia
Replied by wireframemedia on topic Array filter with exclusive option
That is ok. We do not allow the previous button and it will be token-based so they can only go one, way once.

If we do this with Javascript that is ok. I just need the code to use, I can modify it but wouldn't know where to begin by writing it from scratch.

I just need that static option to be available for the last two questions in the cascade series. Then if the user checks it there, they will term out.

That will finalize the survey once this is fixed and we can be done.

Thank you again for all your input.
Dawna
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #48407 by tpartner
Replied by tpartner on topic Array filter with exclusive option
Assuming the survey is in question-by-question mode and that your "static" options are always last in the list, place the following script in the source of each question that you would like the last option to be permanently displayed:
Code:
<script type="text/javascript" charset="utf-8">
 
    $(document).ready(function(){
 
        window.setTimeout(function() {
            $('td.answer li:last').show();
            $('td.answer li:last input[type=hidden]:eq(0)').attr('value', 'on');
        }, 50);
 
    });
 
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • wireframemedia
  • wireframemedia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #48413 by wireframemedia
Replied by wireframemedia on topic Array filter with exclusive option
I will try that right now.

Do I keep the array filter on?

Thanks.
Dawna
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #48414 by tpartner
Replied by tpartner on topic Array filter with exclusive option
Yup, turn on the filter for all questions.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • wireframemedia
  • wireframemedia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #48415 by wireframemedia
Replied by wireframemedia on topic Array filter with exclusive option
Ok I did it and I changed the code of 50 to 98 but it won't show up. Drat!

I tried it both ways with your 50 and with my 98 which is the correct code.

Any ideas?

The browser says "done but with errors..."

Thanks.

Dawna
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose