Welcome to the LimeSurvey Community Forum

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

Format of the slider question if possible

More
3 years 6 months ago - 3 years 6 months ago #241727 by davebostockgmail
Please help us help you and fill where relevant:
Your LimeSurvey version:  5.6.11+230320
Own server or LimeSurvey hosting: Own server
Survey theme/template: Customised Fruity
==================
Just wondering if there was an easy way to format the question container for the slider question. We have a client who would like to see it displayed as in the attached image. 

The scale for some reason would run from 1 to 5.5 in increments of 0.1

Thanks in advance for any help 

Dave
 

Edit - The slider doesn't have to look like this I am just interested in how it can be inserted into a table .. the standard slider layout is fine
Last edit: 3 years 6 months ago by davebostockgmail.

Please Log in to join the conversation.

More
3 years 6 months ago #241749 by tpartner
1) Create a multiple-numeric question with one sub-question and slider enabled.

2) Insert the table HTML in the question sourcelike this:

Code:
<table> <tr> <td>Definitely Would</td> <td>Probably Would</td> <td>Might / Might Not</td> <td>Probably Not</td> <td>Definitely Not</td> </tr> <td class="slider-cell" colspan="5"></td> </tr> </table>

3) Insert this script in the question source. It will move the slider into the table:

Code:
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Move the slider $('.question-text tr:eq(1) td:eq(0)', thisQuestion).append($('.slider-container', thisQuestion)); }); </script>

4) Insert some clean-up styles in the question source like this:

Code:
<style type="text/css" data-author="Tony Partner"> #question{QID} .answer-container, #question{QID} .tooltip { display: none !important; } #question{QID} .question-text table { margin: 20px auto; width: 95%; max-width: 800px; border-collapse: collapse; } #question{QID} .question-text td { padding: 5px 10px; text-align: center; background-color: #FFFFFF; border: 1px solid #E7E7E7; } #question{QID} .question-text td.slider-cell { padding: 15px 10px; } </style>



Sample survey attached:  

File Attachment:

File Name: limesurvey...4461.lss
File Size:40.52 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: davebostockgmail

Please Log in to join the conversation.

More
3 years 6 months ago #241752 by davebostockgmail
Perfect as always .. thanks Tony

Please Log in to join the conversation.

More
3 years 6 months ago #241759 by DenisChenu

Edit - The slider doesn't have to look like this I am just interested in how it can be inserted into a table .. the standard slider layout is fine
 
And this one is included (but we don't have triangle) : f062 in www.limesurvey.org/manual/Question_type_...dle_unicode_shape.29

See fontawesome.com/v4/icons/

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

Moderators: tpartner, holch

Lime-years ahead

Online-surveys for every purse and purpose