Welcome to the LimeSurvey Community Forum

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

Come escludere un'opzioni di risposta dalla randomizzazione

  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #209236 by FrancescaP
Buonasera,

ho un array con 10 opzioni di risposta e 2 sotto-domande. Vorrei escludere dalla randomizzazione la decima opzione (non sa), come posso fare?

Grazie in anticipo,
Francesca
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #209239 by Joffm
Hi, Francesca,
This is the English part of the forum.
Please write English or use the Italian part.

Questa è la parte inglese del forum.
Si prega di scrivere in inglese o utilizzare la parte italiana.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #209244 by FrancescaP
I'm sorry! I didn't realise I was there.

My question is:
Can I exclude a response option from randomization? I have an array with 10 response options and i would like excluding "I don't know".

Thanks,
Francesca
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #209267 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #209290 by FrancescaP
My question type is Array by column.
I would like randomizing 9 option responses and excluding 1 option. That can't use that solution.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #209299 by Joffm
And you want to randomize the answer options, the y-scale?
In my opinion there is no randomization on the answer options at all.
How do you randomize them?

You should show us your idea (screenshot).

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #209382 by FrancescaP
Here in attached my array by column. I used an array by column because i would like one choise for "Primo motivo" and one for "Secondo motivo".
I would like randomizing all option responses, excluding "Non sa".



Thanks,
Francesca
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #209393 by holch
You are aware that with the way you display it, people can answer "Primo motivo" and "Secondo motivo" for the same thing?

Because yes, this way people can only give one answer per column, but in the other column the can chose the very same aspect, which doesn't make sense, does it?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #209407 by Joffm
Hi,
of course, you have to validate.
In my opinion the best solution is to use two multiple questions for 1st and 2nd with "array exclusion filter.

But you can use an array(numbers)
with the randomization, Tony provided in the linked post
Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:complete',function() {
 
    // Define the subquestion code to be fixed at the bottom of the array
    var fixedCode = 'SQ009';
 
    // Move that row to the bottom
    $('#question{QID} table.subquestion-list tbody:eq(0)').append($('tr[id$="X{QID}'+fixedCode+'"]'));
 
    // Fix up the row background colours
    $('#question{QID} tr.answers-list').each(function(i){
      $(this).removeClass('ls-even, ls-odd');
      if(i % 2 == 0) {
        $(this).addClass('ls-even');
      }
      else {
        $(this).addClass('ls-odd');
      }
    });
    // Define the subquestion code to be fixed at the bottom of the array
    var fixedCode = 'SQ010';
 
    // Move that row to the bottom
    $('#question{QID} table.subquestion-list tbody:eq(0)').append($('tr[id$="X{QID}'+fixedCode+'"]'));
 
    // Fix up the row background colours
    $('#question{QID} tr.answers-list').each(function(i){
      $(this).removeClass('ls-even, ls-odd');
      if(i % 2 == 0) {
        $(this).addClass('ls-even');
      }
      else {
        $(this).addClass('ls-odd');
      }
    });
 
 
    });
</script>
As I am unable to create a script I just repeated it (for "others" and "don't know")
But somewhere in the forum I saw a script for a variable number of fixed options.

and a validation like this considering that there may be two selections in the row of "Others" and in "don't know" as well.
count(self.sq_X001)==1 AND count(self.sq_X002)==1 AND
count(self.sq_SQ001)<2 AND
count(self.sq_SQ002)<2 AND
count(self.sq_SQ003)<2 AND
count(self.sq_SQ004)<2 AND
count(self.sq_SQ005)<2 AND
count(self.sq_SQ006)<2 AND
count(self.sq_SQ007)<2 AND
count(self.sq_SQ008)<2


This is fine
1.


2.


Here we get errors
1.

2.


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #209421 by DenisChenu
The issue about choosing same option can be easily fixed with Expression.

Since array number create a lot of columlns : i think it's best to use array by columns.
My opinoon : best is 2 single choice (dropdown) question ;)

Can you send a sample lss file with ONLY that question ?

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.

Lime-years ahead

Online-surveys for every purse and purpose