Welcome to the LimeSurvey Community Forum

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

Multiple choice & exclusive options q

More
9 years 7 months ago #129928 by DB1324
Hi,

I am designing a questionnaire which has a multiple choice question, with answers A, B, C, D, E, None of the above, and Other (the 'Other' field from question settings).

Using the exclusive options feature I can cause all the other options to grey out if a user selects 'None of the above', which is great, but ideally if someone picks this option I'd like them to be able to enter some text in 'Other' too.

So, is it possible to have an 'exclusive options' style grey out that affects all but TWO responses, the selected one and an 'other' option?

(A thousand apologies if the answer is obvious - I'm very new to LimeSurvey :blush: )

Thank you!
The topic has been locked.
More
9 years 7 months ago #129932 by holch
No, exclusive means exclusive. so just this one response is valid. Now you might be able to do something with a custom Javascript, but I am no expert on this.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: DB1324
The topic has been locked.
More
9 years 7 months ago #129933 by DB1324
Thank you for the prompt response. Unfortunately I am no expert in Javascript either - I was hoping I'd overlooked something simple.
The topic has been locked.
More
9 years 7 months ago - 9 years 7 months ago #129940 by mguerrero
Hi,

I think with this example achieved it what you need.

You must remove the exclusive option
Code:
<script>
 
$(document).ready(function() {
 
  var thisQuestion = $('#question{QID}');                
 
  $('ul.subquestions-list li', thisQuestion).addClass('normalOpt');
  $('ul.subquestions-list li', thisQuestion).each(function(i) {
    $('.other-item').removeClass('normalOpt').addClass('exlusiveOpt');
    $('.exlusiveOpt').prev().removeClass('normalOpt').addClass('exlusiveOpt2');
  });
 
 
  $('.exlusiveOpt2 input[type=checkbox]').change(function(event) {
    if($(this).is(':checked'))
    {
      $('.normalOpt input[type=checkbox]').prop('disabled', true);
      $('.normalOpt input[type=checkbox]').prop("checked", false);
      $('.normalOpt input[type=checkbox]').val('');
    }
    else{
      $('.normalOpt input[type=checkbox]').prop('disabled', false);
 
    }
  });
 
 
 
});
 
</script>


Cheers
Last edit: 9 years 7 months ago by mguerrero.
The following user(s) said Thank You: DB1324
The topic has been locked.
More
9 years 7 months ago #129946 by DenisChenu
No need javascript : use filter for each subquestion.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: DB1324
The topic has been locked.
More
9 years 7 months ago #129950 by DB1324
I don't suppose you would be so kind as to give me a hint on how to do that (I can see filters in advanced settings for the question, but not at level of subquestions...)?

Thank you!
The topic has been locked.
More
9 years 7 months ago #129959 by DenisChenu
You need to be on 2.06 version, don't remind the exact build. It's when you edit the Sub question.

You can copy paste the "auto generated" equation done with array_filter (with question logic files) , and remove it after.

Denis
PS : we really need to do a clean manual part for this ....

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: DB1324
The topic has been locked.
More
9 years 4 months ago #133685 by first
I tried and this actually hide the desired sub-question .. not disable them like exclusive option do...

Survey Designer and Programmer
The topic has been locked.
More
9 years 4 months ago #133687 by DenisChenu

OMdev wrote: I tried and this actually hide the desired sub-question .. not disable them like exclusive option do...

We have a manual : www.limesurvey.org/manual/Question_type_...rray_filter_style.29

Did you try to use deactivate here ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
9 years 4 months ago #133698 by first
Kool.. Just slipped from my mind...

Survey Designer and Programmer
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose