Welcome to the LimeSurvey Community Forum

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

side-by-side question with form [Likert array | textbox] possible?

More
4 years 5 months ago - 4 years 5 months ago #212836 by markheckmann
Is it possible to design a side-by-side question, with a Likert-scale like array on the left and a textbox on the right? Please find an example from Qualitrics below/attached  (I plan to migrate to LimeSurvey and need to check feasibility). [This question might be loosely connected to this thread, but I am not sure: forums.limesurvey.org/forum/design-issue...from-the-user#212810 ].



Thanks! :)
Mark
Last edit: 4 years 5 months ago by markheckmann. Reason: correction // image was accidently inserted twice before

Please Log in to join the conversation.

More
4 years 5 months ago #212840 by Joffm
Hi, Mark,
no, your link is something quite different.

But you may do this
 

Create a question of type "multiple short text" after the array question and insert this into the question text of the array.
Code:
<script type="text/javascript" charset="utf-8">
// A JQuery plugin to insert comments into a specified column of a normal radio array VERSION 1
(function( $ ){
 
    $.fn.cbArrayComments3 = function(options) {  
 
        var opts = $.extend( {
            column: -1 // Text Input column (-1 will default to last column) 
        }, options);
 
        return this.each(function() { 
 
            // Identify the questions
            var thisQuestion = $(this);
            var q1ID = $(thisQuestion).attr('id').replace(/question/, '');
            var thisQuestion = $('#question'+q1ID);
            var nextQuestion = thisQuestion.nextAll('.multiple-short-txt:eq(0)');
            var q2ID = $(nextQuestion).attr('id').replace(/question/, '');
 
            //Hide the multiple-short-text
            nextQuestion.hide();
 
            // Move the text inputs
            var column = $('tr.answers-list:eq(0) td.answer-item', thisQuestion).length;
            if(opts.column > 0) {
                column = opts.column;
            }
 
            $('tr.answers-list', thisQuestion).each(function(i) {
                var thisCode = $(this).attr('id').split('X')[2].split(q1ID)[1];
                $('td.answer-item:eq('+(column-1)+') input[type="radio"]', this).css({
                    'position': 'absolute',
                    'left': '-9999em'
                });
                $('td.answer-item:eq('+(column-1)+')', this).removeClass('radio-item').addClass('inserted-text-item').append($('input[type="text"][id$="X'+q2ID+thisCode+'"]', nextQuestion));
            });
 
        });
 
    };
})( jQuery );
    $(document).on('ready pjax:scriptcomplete',function(){
    var thisQuestion = $('#question{QID}');
    // Add a question class
    thisQuestion.addClass('custom-array');
    // Column-specific classes
    $('table.subquestion-list tr', thisQuestion).each(function(i) {
      $('th, td', this).each(function(i) {
        $(this).addClass('column-'+i);
      });
    });
        $('#question{QID}').cbArrayComments3({
            column: 7 // Text Input column (-1 will default to last column)
        });
    });
</script>

This css snippet is to set the different column width
Code:
<style type="text/css">.custom-array table.subquestion-list col {
    width: auto !important;
  }
 
  .custom-array table.subquestion-list thead .column-0 {  width: 20%; }
  .custom-array table.subquestion-list thead .column-1 {  width: 7%; }
  .custom-array table.subquestion-list thead .column-2 {  width: 7%; }
  .custom-array table.subquestion-list thead .column-3 {  width: 7%; }
  .custom-array table.subquestion-list thead .column-4 {  width: 7%; }
  .custom-array table.subquestion-list thead .column-5 {  width: 7%; }
  .custom-array table.subquestion-list thead .column-6 {  width: 7%; }
  .custom-array table.subquestion-list thead .column-7 {  width: 38%; }
</style>

Sample survey:
 

File Attachment:

File Name: limesurvey... (2).lss
File Size:31.35 KB


Joffm

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

Please Log in to join the conversation.

More
4 years 5 months ago #212843 by markheckmann
Hi Joffm,

thanks a lot for your reply! Your .lss file works well when I upload it.
However, for my own example, I cannot get it to work by inserting the supplied JS/CSS code. The last column does not appear, and the "multi short text" box disappears. I attached my .lss file.
Did I do something wrong?

Thanks!
Mark
 

Please Log in to join the conversation.

More
4 years 5 months ago #212845 by Joffm
Yes,
you didn't do what there is in my sample

As you see here

        $('#question{QID}').cbArrayComments3({
            column: 7 // Text Input column (-1 will default to last column)
        });


the javascript refers to the 7th column.
But you have only six answer option in your array.
You have to add this 7th column where the short text is inserted.

 

And in my opinion it is obsolete to say always "trifft... zu". These answer option text should be short.
Do it once in the question text
or use a second header as shown in your first picture.

Joffm

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

Please Log in to join the conversation.

More
3 years 6 months ago #225307 by ployrich
Hi,
I know it's an old thread, still worth a try. I saw similar solution for LS v5. As we are staying with Version 3.27.14, self-hosted for now I wanted to ask here.

Is there a way to achieve this type of design in the question-by-question presentation style? Is there a way to put it into a question template?

Thanks in advance.

Please Log in to join the conversation.

More
3 years 6 months ago #225309 by Joffm

Is there a way to achieve this type of design in the question-by-question presentation style?

Therefore we often recommend to display "group by group" with one question in each group"
Look&Feel as "question by question" but with additional option to merge questions by javascript.

Joffm
 

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

Please Log in to join the conversation.

More
3 years 6 months ago #225367 by ployrich
So the short answer is no?
The "mixing" of two questions would make our post processing a lot more "confusing" as the single choice buttons are meant to encode the non-response options connected to each of the inputs.

Maybe I will try my hand at a template, which would probably meaning a lot of "fake" buttons and autofilling the input value. Unless someone with better understanding of question types and the LS architecture behind it that it would make any sense.

Thanks anyways

Please Log in to join the conversation.

More
3 years 6 months ago #225369 by Joffm
What did you really want?
The text input as a comment?
Or as a further open answer option? That you either select a button or enter something into the text field.
​​​​​​this would be a different script.

In any case you have to read all mentions, code them.
The rest is easily done by an Excel macro or a SPSS script.

And don't forget the database.
 In an array there is one column to store a number (Varchar(5)) for each subquestion.
To store the texts you need a column of type "text" for each subquestion.
​​​​​
Joffm

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

Please Log in to join the conversation.

More
3 years 6 months ago #225379 by ployrich
I want what is display in this post
forums.limesurvey.org/forum/can-i-do-thi...ith-radiolist#223422
with one input column.
+ what you mentioned: Either people enter into the input field or they select a button. What script would that be?

For further background: the process I am trying to fit this type of design in is at the moment built around the assumption that we have one question per page. And I am trying to gauge the effort and feasablity to stick to this paradigm. If there is as you have hinted in your first answer no way around putting those two question together it will be the way. It feels not logical to me yet to put every other question separately in a group to produce this one particular design.

Please Log in to join the conversation.

More
3 years 6 months ago #225383 by Joffm

It feels not logical to me yet to put every other question separately in a group to produce this one particular design.

Agreed, it is not,
but if you saw the discussions about the missing separation between visual and logical grouping in LimeSurvey, you'd know why we recommend this.
It is a flexible way taking in account the existing limitations as you can mix the following options
  • Display like "question by question"
  • Display several questions on one page (like "group by group")
  • Use javascript snippets that require different questions to merge
I am aware of other limitations of this method, as you cannot display sets of questions randomly (like: Either Q1a, Q1b, Q2a, Q2b, Q2c  or Q2a, Q2b, Q2c, Q1a, Q1b)

Here a link to a nearly six years old thread, ... and nothing changed since
[url] forums.limesurvey.org/forum/can-i-do-thi...ocks-of-pages#133907 [/url]

I know, other tools have options to distinguish between "blocks" (the logical grouping, used for something like randomization) and "groups" (the visual grouping, how many questions are on one page, horizontally, vertically or both). LimeSurvey has not, but it's free.

Remember: You want to have a layout that is not built in. So there is a javascript workaround (meaning: the built in question types are used, and only the display on the screen of the participant's device is manipulated.)
If you require something not built in, you have to be aware of some consequences.

Joffm

What script would that be?

In this thread (I know it is very long) you find a lot of solutions
[url] forums.limesurvey.org/forum/can-i-do-thi...array?start=0#166884 [/url]

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner

Please Log in to join the conversation.

More
3 years 6 months ago #225384 by tpartner

+ what you mentioned: Either people enter into the input field or they select a button. What script would that be?


It seems to me that this is exactly what you are looking for - forums.limesurvey.org/forum/can-i-do-thi...array?start=0#166884

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 6 months ago #225386 by Joffm
@tpartner,
so we linked the same thread.

Joffm

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

Please Log in to join the conversation.

More
3 years 6 months ago #225387 by ployrich
Dear Joffm,
maybe I am misreading your tone, nor is it important if I am. I am not critiquing LimeSurvey, I am sold on using LS because it is free and quite powerful. But I am also not aware of such discussions (how should I if I am "just starting out"). I am merely trying to make a survey that fits my needs.

So thank you also to tpartner I will take a look at that long thread.

Please Log in to join the conversation.

More
3 years 6 months ago #225389 by holch

It feels not logical to me yet to put every other question separately in a group to produce this one particular design.

While I am probably the most vocal advocate of a separation between visual grouping (page concept) and logical grouping (question groups), at the end of the day, with other tools you usually need to create a "page" to have more than one question on the same page, here you need to put them in a group. Not that much of a difference. I can't remember how exactly the other tools that I have used back in the time have solved this.

I would wish for a page concept, where I can position questions visually in the sampe group / on the same page, while I could still maintain any logical question grouping. But I am advocating this for years and nothing has happened.

So at the end, you will need to position each question in a group and then those two together into one, and then use some javascript.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
3 years 6 months ago - 3 years 6 months ago #225403 by Joffm
Oh, sorry,
It is because I came across your username several times. Now I saw that you are a member of the forum for nearly two years.
I therefore assumed that you had already encountered this point of criticism, which arises again and again at more or less regular intervals.
Mainly from users who know these options from other tools.
And as @holch wrote, he is the most vocal advocate for this feature.

I just wanted to explain that non-default items cannot be easily added without concessions.

To explain this behavior in another tool (Nebu)
By default, question by question is displayed. No chance to change.
But there is a special type called "grouping" that can contain several questions which are displayed on one page.. Furthermore this "group" can contain another type "grouping". And you can group horizontally or vertically.
Here the question tree
 

and the result on the screen
 

Separately there is a type called "block".
To do randomizations, and also loops (another feature missing in LimeSurvey).
But here, too, the users criticize that a "block in block" is not possible. 

And - as a free tool for non-commercial use - I saw that SoSci-Survey contains the option to merge questions horizontally
Here shown on their website
 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 6 months ago by Joffm.
The following user(s) said Thank You: ployrich

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose