Welcome to the LimeSurvey Community Forum

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

Array question with two-line answer options

  • sinaba7
  • sinaba7's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208810 by sinaba7
Hello,

I would like to use the SVO slider (Murphy et al., 2011 --> see picture) in a survey . I think an array question type would be suitable but I don't know how to add a two-line description to the answer options ("You receive", "Other receives" one below the other).

Does any of you have an idea?

Thanks in advance,
Sina
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208821 by Joffm
Hi, Sina,
like this?

Your answer options:
<span style="text-align:center">20<br>|<br>70</span>
<span style="text-align:center">25<br>|<br>65</span>
...

And to get the text into the uppper left corner use this javascript snippet
Insert it into the question text (source code mode)
Code:
<script type="text/javascript" charset="utf-8">  
    $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Insert header text
    var insertedText = "You receive<br>|<br>Other receive";
    $('table.subquestion-list thead tr:last td:first', thisQuestion).addClass('inserted-header').append(insertedText);
  });
</script>

and also this css.
Code:
<style type="text/css">td.inserted-header {
  font-weight: bold;
  text-align: center;
  vertical-align: middle !important;
}
</style>

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago - 3 years 4 months ago #208852 by Joffm
To add:
There is a workaround in the respective section of the manual
manual.limesurvey.org/Workarounds:_Manip...Off_Matrix_Interface

It will not work in version 3.x.


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 4 months ago by Joffm.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208866 by tpartner
Replied by tpartner on topic Array question with two-line answer options
Would there be enough interest to warrant a custom question theme?

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
3 years 4 months ago #208871 by DenisChenu
Replied by DenisChenu on topic Array question with two-line answer options
Without JS ? Can be great ;)

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.
  • sinaba7
  • sinaba7's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago - 3 years 4 months ago #208883 by sinaba7
Replied by sinaba7 on topic Array question with two-line answer options
Thank you so much, Joffm! The ideas from your first reply work out perfectly :)
Last edit: 3 years 4 months ago by sinaba7.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago - 3 years 4 months ago #208969 by tpartner
Replied by tpartner on topic Array question with two-line answer options

DenisChenu wrote: Without JS ? Can be great ;)

Here is a custom question theme - github.com/tpartner/LimeSurvey-Social-Value-Orientation

The theme is fully functional without JavaScript enabled. JavaScript is only used to load the dynamic values in the top and bottom labels.



Note, due to the buggy nature of LS4, I don't recommend using it there yet - bugs.limesurvey.org/view.php?id=16876

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 4 months ago by tpartner.
The following user(s) said Thank You: DenisChenu, holch
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose