Welcome to the LimeSurvey Community Forum

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

Different Radio buttons(7 point likert scale) for each sub question

  • Venkatesh191994
  • Venkatesh191994's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208992 by Venkatesh191994
Dear Team,

I am trying to create a question block consisting of three sub questions and I need different set of radio buttons. Currently I can have only one type of radio buttons for the entire block.

For. eg. subquestion 1. Expensive - Non Expensive subquestion 2. High - Low
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208995 by Joffm
Hi,
well, of course a question of type array is usually used to rate some items on the same scale.
But you can do this

Code:
<script type="text/javascript" charset="utf-8">    
  $(document).ready(function() {  
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Define the sub-heading text strings
    var subHeading1 = '<span style="color:maroon">Beoordeel hoe de personen op de afbeelding sich voelen</span><br/><span style="font-size=8pt">(Let op: Nem et perspectief van de personen op de afbeelding niet je eigen perspectief)</span>';
    var subHeading2 = '<span style="color:maroon">Beoordeel hoe intens de personen op de afbeelding deze emotie ervaren</span><br/><span style="font-size=8pt">(Let op: Nem et perspectief van de personen op de afbeelding niet je eigen perspectief)</span>';
    var subHeading3 = '<span style="color:maroon">In welke mate wordt er sociale interactie afgebeeld</span>';
 
    var columnsLength = $('tr.answers-list:eq(0) > *', thisQuestion).length;
 
    // Insert the new rows
    $('tr.answers-list:eq(0)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading1+'</th></tr>');
    $('tr.answers-list:eq(1)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading2+'</th></tr>');  
    $('tr.answers-list:eq(2)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading3+'</th></tr>');  
 
    // Fix up the row classes
    var rowClass = 1;
    $('table.subquestions-list tbody tr', thisQuestion).each(function(i) {
      if($(this).hasClass('sub-header-row')) {
        rowClass = 1
      }
      else {
        rowClass++;
        $(this).removeClass('array1 array2')
        if(rowClass % 2 == 0) {
          $(this).addClass('array2');
        }
        else {
          $(this).addClass('array1');
        }
      }
    });
  });
</script>
Code:
<style type="text/css">.sub-header-row { margin-bottom: 20px; } .sub-header-row th { background-color: #efefef; color: #000000 !important; text-align: left; }
</style>

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Venkatesh191994
  • Venkatesh191994's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208996 by Venkatesh191994
Thanks a ton Joff. Where do I need to include this. Is it in the source code. I am new to coding and limesurvey, apologies if this is a silly question.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208999 by Joffm
By the way:
Which version do you use?
This is for version 3.x.
We do not recommend version 4.x. at the moment because it is still unstable.

And yes
question text (source code mode)

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Venkatesh191994
  • Venkatesh191994's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #209026 by Venkatesh191994
Thanks Joffm!!
I am using 3.x. Thanks for your reply
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose