Welcome to the LimeSurvey Community Forum

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

Ordinamento casuale (random) solo di alcune risposte

  • Intwig00
  • Intwig00's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #200665 by Intwig00
Buongiorno,

ho una lista di 5 risposte (radio button). Avrei bisogno di ordinare in maniera casuale lasciando le ultime 2 opzioni fisse nella loro posizione.

Esiste un sistema per randomizzare solo alcune delle opzioni di risposta?

grazie
The topic has been locked.
  • lfanfoni
  • lfanfoni's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #200668 by lfanfoni

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
More
3 years 10 months ago #201408 by crimba
Ciao, ma dove trovo "Randomize on each page load"?
Io ho solo la tendina Random "Yes"
The topic has been locked.
  • lfanfoni
  • lfanfoni's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201413 by lfanfoni
Forse fa riferimento a una vecchia traduzione. Ma non ti funziona il workaround se metti Random=Yes?

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
More
3 years 10 months ago #201414 by crimba
A me non funziona, pensavo ci fosse un problema sul fatto che forse carica già i risultati mescolati e poi fa li mette alla fine. Sto smanettando sul js per capire.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201416 by Joffm
Buongiorno

Quale versione usi?

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 10 months ago #201423 by crimba
Versione 4.2.8+200608
The topic has been locked.
More
3 years 10 months ago #201424 by crimba
Cmq ho risolto così:
Code:
<script type="text/javascript" charset="utf-8">  
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // The number of answers to be fixed at the end of the list
    var fixedAnswers = 2;
 
    // Set this to "true" if you want "Other" to be fixed in the last position
    var otherFixed = false;
 
    // Identify this question
    var qID = {QID}; 
 
    // Find the number of answers
    var ansCount = $('#question'+qID+' .answer-item').length;
    if($('#question'+qID+' input[type="text"]').length > 0) {
      ansCount = ansCount -1
    }
 
    // Place the last n answers created at the end of the list
    var fixedIndex = fixedAnswers - 1;
    var fillFixedIndex;
    for (var i=0; i<fixedAnswers; i++) {
        var fillFixedIndex = ('0' + (ansCount-fixedIndex)).slice(-2);
 
      var answer = $('input[id^="answer"][id$="X'+qID+"SQ"+(fillFixedIndex)+'"]');
 
 
      var answerItem = $(answer).closest('.answer-item');
      var answersList = $(answer).closest('ul');
      $(answersList).append(answerItem);
      fixedIndex--;
    }    
 
    // Handle "Other"
    if(otherFixed == true &amp;&amp; $('#question'+qID+' input[type="text"]').length > 0) {
      var otherAnswer = $('#question'+qID+' input[type="text"]');
      var otherAnswerItem = $(otherAnswer ).closest('.answer-item');
      var otherAnswersList = $(otherAnswer ).closest('ul');
      $(otherAnswersList).append(otherAnswerItem);
    }
  });
</script>
The topic has been locked.
  • lfanfoni
  • lfanfoni's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201426 by lfanfoni
In effetti non funziona. Ti consiglio di postare sul forum generale in inglese, specificando la versione ma anche che il workaround non funziona. Oppure apri un nuovo post qui nel forum in italiano, indicando sempre versione e problematica. Sicuramente Joffm potrà aiutari.

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
More
3 years 10 months ago #201511 by crimba
Con lo script che ho postato sopra va. Ho messo dei checkbox a scelta multipla come domanda.
The topic has been locked.
  • lfanfoni
  • lfanfoni's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201519 by lfanfoni
Sulla versione 3.X il tuo script non mi funzionava, appena posso lo provo sulla versione 4

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
Moderators: lfanfoni

Lime-years ahead

Online-surveys for every purse and purpose