Welcome to the LimeSurvey Community Forum

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

Array dual scale with question in the middle!!!

  • jimmyrazor
  • jimmyrazor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 6 months ago #175180 by jimmyrazor
Hi community,

I have to implement a lime survey version of an existing paper and pencil questionnaire. In this questionnaire we have a couple of items that have to be answered on two scales.

The question type "Array dual scale" seems to be appropriate for this issue, but the standard layout is Item - Scale A - Scale B.

It is important for us to use the layout we have in the paper and pencil version, and that ist Scale A - Item - Scale B (see attached scheme).

I'm sure, this is possible in LimeSurvey. Does anyone have a solution for us?
The topic has been locked.
More
5 years 6 months ago #175185 by jelo
What version of LimeSurvey is used? Workarounds depend on the version.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175187 by DenisChenu
Replied by DenisChenu on topic Array dual scale with question in the middle!!!
I don't remind if it work, can depend on version.

But trye
Code:
|in the middle|
or
Code:
|middle|

After : maybe some width to fix :)

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.
More
5 years 6 months ago #175204 by jelo
Never seen using two separators. Was that introduced in LS3?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175210 by DenisChenu
Replied by DenisChenu on topic Array dual scale with question in the middle!!!
No, it exist before …

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175219 by holch
Is this described anywhere in the manual? I have never seen this before either!

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175220 by DenisChenu
Replied by DenisChenu on topic Array dual scale with question in the middle!!!

holch wrote: Is this described anywhere in the manual? I have never seen this before either!

Maybe at a time, must be done (but i didn't add the function ;) )

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175222 by tpartner
It's completely broken in 3.x:

- adding unnecessary HTML elements
- not handling widths





Here is a working JavaScript solution. Add this to the source of the question:

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
 
    // Calculate widths    
    var tableWidth = $('table.subquestion-list:eq(0)', thisQuestion).width();
    var sqWidth = $('.col-answers:eq(0)', thisQuestion).width();
    var sqPercent = (sqWidth/tableWidth)*100;
    var answersCount = $('.col-responses col', thisQuestion).length;
    var answersWidth = (tableWidth-sqWidth)/answersCount;
    var answersPercent = (answersWidth/tableWidth)*100;
 
    // Move table elements and remove unnecessary elements
    $('col.separator:eq(0)', thisQuestion).parent().after($('col.col-answers:eq(0)', thisQuestion).parent()).remove();
    $('thead tr.ls-heading.groups td.header_separator:eq(0)', thisQuestion).after($('thead tr.ls-heading.groups th:eq(0)', thisQuestion)).remove();
    $('thead tr.ls-heading:last td.header_separator:eq(0)', thisQuestion).after($('thead tr.ls-heading:last td:eq(0)', thisQuestion)).remove();
    $('tr.answers-list', thisQuestion).each(function(i) {
      $('.dual_scale_separator:eq(0)', this).after($('th.answertext', this)).remove();
    });
 
    // Assign new widths
    $('.col-answers', thisQuestion).css('width', sqPercent+'%');
    $('.col-responses col', thisQuestion).css('width', answersPercent+'%');
  });
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...0-08.lss
File Size:26 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175232 by DenisChenu
Replied by DenisChenu on topic Array dual scale with question in the middle!!!

tpartner wrote: It's completely broken in 3.x:

Please : report issue

- adding unnecessary HTML elements

What unnecessary element ? remind we need to show it too with sub-question|middle|right on phone (reason of ls-label-xs-visibility) and need accessibility.

tpartner wrote: - not handling widths

Yes : right, except with 3 input for "subquestion" part width : i don't see how to set this.

Else : i don't know what width you use for screenshot …

Without update i have



And with this script :
Code:
<script>$(document).on('ready pjax:scriptcomplete',function(){
$("#question{QID} col.col-answers").width("0");
$("#question{QID} col.separator:not(.right_separator)").width("30%");
$("#question{QID} col.separator.right_separator").width("0");
});
</script>

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago - 5 years 6 months ago #175233 by tpartner

What unnecessary element ? remind we need to show it too with sub-question|middle|right on phone (reason of ls-label-xs-visibility) and need accessibility.

The OP simply wanted the subquestion text in the middle. There was no mention of left/right text. I simply used your example for sub-questions using current vanilla theme, screen width ~1028px and you can see the results in my first screenshot.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 6 months ago by tpartner.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175243 by DenisChenu
Replied by DenisChenu on topic Array dual scale with question in the middle!!!

tpartner wrote: The OP simply wanted the subquestion text in the middle. There was no mention of left/right text. I simply used your example for sub-questions using current vanilla theme, screen width ~1028px and you can see the results in my first screenshot.

Yep, the 33% automatic width is to wide if there are middle and right … and this make a total width of 66% for all parts …

When user set "subquestion width" : it's the subquestion width part
If it not set : i prefer to keep 33% see discussion here : bugs.limesurvey.org/view.php?id=11726

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.

Lime-years ahead

Online-surveys for every purse and purpose