Welcome to the LimeSurvey Community Forum

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

Dual Scale Array to Multiple Scale Array Possibility?

More
12 years 1 week ago #78763 by DianaS7
Hi Tony,

The multiple scale array is working perfectly in Google Chrome and Internet Explorer, but it doesn´t work in Mozilla.

There´s anything I can do?

Thanks,

Diana
The topic has been locked.
  • lsorg
  • lsorg's Avatar
  • Visitor
  • Visitor
10 years 9 months ago - 10 years 9 months ago #98099 by lsorg

tpartner wrote: Ah, okay, use this:

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).ready(function() {
    // Loop through all questions (except boilerplates) and add some classes
    $('div[id^="question"]').each(function(i){
      if (!$(this).hasClass('boilerplate')) {
        $(this).addClass('inlineQuestion inlineQuestionSub');
      }
    });
    $('.inlineQuestionSub:first').removeClass('inlineQuestionSub').addClass('inlineQuestionPrime');
 
    // Wrap the questions in a div
    $('.inlineQuestion').wrapAll('<div class="inlineWrapper" />');
 
    // Remove the text from the secondary questions
    $('.inlineQuestionSub th.answertext').text('');
 
    // Apply some styles (these are for the default template)
    $('.inlineQuestion').css({ 'float': 'left' });
    $('.inlineQuestion col, .inlineQuestion th.answertext').css({ 'width': 'auto' });
    $('.inlineQuestion .question-wrapper').css({ 'width': '100%' });
    $('.inlineQuestion td.answer').css({ 'padding': '0.5em 0' });
    $('.inlineQuestion td.questiontext').css({ 'text-align': 'center' });
 
    // Center the wrapper div
    var wrapperWidth = 0;
    $('.inlineQuestion').each(function(i){ 
      wrapperWidth = wrapperWidth + $(this).width();
      var padLeft = $('.answertext:eq(0)', this).width() + 3;
      $('.questiontext', this).css({ 'padding-left':padLeft+'px', 'padding-right':'3px' });
    });
    $('.inlineWrapper').css({ 'width':wrapperWidth+'px', 'margin': '0 auto' });
 
    // Set the row heights
    var wrapperWidth = 0;
    $('.inlineQuestionSub').each(function(i){
      $('tbody[id^="javatbd"]', this).each(function(i){ 
        var ansHeight = $('.inlineQuestionPrime th.answertext:eq('+i+')').innerHeight();
        //$('th.answertext', this).css({ 'height':ansHeight+'px' });
 
        if($.browser.mozilla) {
          $('th.answertext', this).height(ansHeight);
        }
        else {
          $('th.answertext', this).innerHeight(ansHeight);
        }
      });
    });
  });
 
</script>


Hey guys,

I'm using limesurvey since a few days and it is fantastic.
Now I had the same issue like the thread starter. I copy the script and it worked to build the questions side by side.

But my problem is that it builds all question in the chapter side by side. But I only want the first and the second question side by side.

Does anyone know how I can change the script code that it only puts the questions side by side that I want? I think it would work with the question id, but I don't know how.

Best regards,
lsorg
Last edit: 10 years 9 months ago by lsorg.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 9 months ago #98115 by DenisChenu
$('div[id^="question"]').each(function(i){

to

$('#question42,#question43').each(function(i){
If your question number are 42 and 43.

Please read jquery documentation : api.jquery.com/category/selectors/

Denis

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.
  • lsorg
  • lsorg's Avatar
  • Visitor
  • Visitor
10 years 9 months ago #98129 by lsorg
Great job. That's amazing, it works fantastic.

Thanks.
The topic has been locked.
More
8 years 1 month ago #132899 by dagustin
Hi everyone!

I have the same problem as Newbeedu. The main difference is that I must use selectboxes because the answers list is very long. I tried with Tpartner's script but it doesnt work. Could someone help me?

Thank you and have a nice day!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #132902 by tpartner
dagustin, this topic and the workarounds are very old and may not be suitable for recent versions. Please start a new thread explaining exactly what you are trying to do and include screenshots, your LimeSurvey version number and a small sample survey.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose