Welcome to the LimeSurvey Community Forum

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

Help to make custom arrays

  • Absaw1
  • Absaw1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago - 3 years 4 months ago #225266 by Absaw1
Help to make custom arrays was created by Absaw1
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.25.20+210330
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template:
==================
Hi everyone,

I want to build a survey with predesigned questions containing some arrays that are different from the built-in arrays in the app and i wondered if i could get some help to design those arrays.
There are three array designs that i want.

The first one is made of three columns, the middle one is where the texts of the questions (attributes names in the example) should be and the left qnd right ones are radio buttons for the user decision (very important/not important attribute) and it should look like the one on "image_1.png" (check attachments).

The second one is an array with 6 columns, each row of them containing text except for the last one where there should be drop-down lists (starting from the second row), for example check "image_2.png".

The last one is similar to the second one but with only 5 columns and in the last one there should be mutually exclusive radio buttons instead like on the file "image_3.png"

Thank you for any help you can provide.
 
Last edit: 3 years 4 months ago by Absaw1.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #225267 by Joffm
Replied by Joffm on topic Help to make custom arrays
Hi,
nice image.
Please, do not copy images but attach them here. You see what happens.

But if I understood your few words correctly, you want to achieve something like this?
 

This is done by a normal array with this script
Code:
<script type="text/javascript" charset="utf-8">
 
    $(document).on('ready pjax:scriptcomplete',function(){
 
        // Define this question
        var thisQuestion = $('#question{QID}');
 
 
        // Move the last column
        $('col:nth-last-child(2)', thisQuestion).before($('col:last-child', thisQuestion));
        $('col:nth-last-child(3)', thisQuestion).before($('col:nth-last-child(2)', thisQuestion));
        $('col:nth-last-child(4)', thisQuestion).before($('col:nth-last-child(3)', thisQuestion));
 
        $('table.subquestion-list tr', thisQuestion).each(function(i) {
            $('> *:nth-last-child(2)', this).before($('> *:last-child', this));
            $('> *:nth-last-child(3)', this).before($('> *:nth-last-child(2)', this));
            $('> *:nth-last-child(4)', this).before($('> *:nth-last-child(3)', this));
        });
    });
</script>

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #225269 by Joffm
Replied by Joffm on topic Help to make custom arrays
Forgot to mention that here the display as "semantic differential" is used without the left side.
So each subquestion starts with the pipe symbol "|"

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose