Welcome to the LimeSurvey Community Forum

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

indent of specific answers in multiple choice question

  • andrej.lindic
  • andrej.lindic's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #231708 by andrej.lindic
Hi!

I have multiple choice question where answers are categorized. By searching forum I found a solution to remove checkbox before category title: [url] forums.limesurvey.org/forum/can-i-do-thi...ith-comments?start=0 [/url]

But what I would also like is to indent answers in specific category. So category title is left aligned and answers in category are moved to the right.

Our LS version is 5.3.14+220516.

Is there a solution for that?

Thank you in advance,

Andrej
Attachments:

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #231713 by Joffm
Hi,
if you used this solution to hide the checkboxes
Code:
<script type="text/javascript" charset="utf-8">
    $(document).on('ready pjax:scriptcomplete',function(){
        $('#question{QID} .answers-list li:eq(0)').addClass('hidden-checkbox');
        $('#question{QID} .answers-list li:eq(4)').addClass('hidden-checkbox');
        $('#question{QID} .hidden-checkbox input').remove();
    });
</script>
 
<style type="text/css">
    #question{QID} .hidden-checkbox {
        padding: 0;
    }
    #question{QID} .hidden-checkbox label {
        padding: 0;
        font-weight: bold;
        font-style: italic;
    }
 
    #question{QID} .hidden-checkbox label::before,
    #question{QID} .hidden-checkbox label::after {
        display: none;
    }
</style>

add this to the css part
Code:
    #question{QID} .checkbox-item:not(.hidden-checkbox) {
        margin-left: 2.5em;
    }
 

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
1 year 7 months ago #231718 by Joffm
Addition:
If you do not want to indent ALL subquestions you have to add a class to ALL of these, like the "hidden-checkbox", eg. "indented-checkbox"

Then you can't use the ":not()" but have to say
Code:
#question{QID} .checkbox-item.indented-checkbox) {
margin-left: 2.5em;
}
 

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

Please Log in to join the conversation.

  • andrej.lindic
  • andrej.lindic's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #231719 by andrej.lindic
Replied by andrej.lindic on topic indent of specific answers in multiple choice question
Problem is that I do not want to indent all of them, just specific ones.

Because I have answers that don't belong in any category. Those should display in default fashion.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #231723 by Joffm
Therefore my addition 

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

Please Log in to join the conversation.

  • andrej.lindic
  • andrej.lindic's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #231727 by andrej.lindic
Replied by andrej.lindic on topic indent of specific answers in multiple choice question
I apologize. Guess we were posting at the same time and I didn't notice.

Thank you very much.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose