Welcome to the LimeSurvey Community Forum

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

"Exclusive option" in array

More
4 years 7 months ago #187895 by EnricoCaruso
Replied by EnricoCaruso on topic "Exclusive option" in array
The script and sample survey currently do not work with LimeSurvey version 3.17.9. I can not find what's going on. Maybe there is a version conflict here.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago - 4 years 7 months ago #187902 by Joffm
Replied by Joffm on topic "Exclusive option" in array

Maybe there is a version conflict here.

Yes, this is very probable.
This thread ended three and a half years ago and the screenshot shows a template of version 2.05 / 2.06 (I think)

So please add your sample survey as *.lss, explain what you want to do, and we will try to find a solution.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 7 months ago by Joffm.
The following user(s) said Thank You: EnricoCaruso
The topic has been locked.
More
4 years 7 months ago #187934 by EnricoCaruso
Replied by EnricoCaruso on topic "Exclusive option" in array
A rating of individual statements is required, with simultaneous distribution of the ranking (exclusive answer per column, except last column). The script from tpartner tpartner on topic Need a replacement for Ranking Questionhere

File Attachment:

File Name: limesurvey...5517.lss
File Size:31 KB
goes in the right direction, only it works for all columns. I can not get an exception for the last column. The solution in this forum where the individual Exclusive columns can be specified is good, but it does not work.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #187949 by tpartner
Replied by tpartner on topic "Exclusive option" in array
This will make all columns except the last exclusive:

Code:
<script type="text/javascript" charset="utf-8">
 
$(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var qID = {QID};
 
    // Answers are exclusive by column (except last column)
    $('#question'+qID+' td:not(:last-child) input[type="radio"]').click(function(event){
      var thisAnsCode = $(this).attr('id').split('-')[1];
      $('#question'+qID+' input[id$="-'+thisAnsCode+'"]').prop('checked', false);
      $(this).prop('checked', true);
    });
  });
</script>

Here is your sample survey back with that script:

File Attachment:

File Name: limesurvey...5171.lss
File Size:32 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: EnricoCaruso
The topic has been locked.
More
4 years 7 months ago #187950 by EnricoCaruso
Replied by EnricoCaruso on topic "Exclusive option" in array
Thank you, it works great!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose