Welcome to the LimeSurvey Community Forum

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

Create column headers - multiple choice questions

  • greenwoodtree
  • greenwoodtree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258369 by greenwoodtree
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
LimeSurvey Cloud   Version 6.4.11
Own server
Template - amended Fruity 23

I am trying to create headers for two columns in a multiple choice question. I followed the code suggested several years ago in the Forum to hide the answer box, but it does not appear to work for me. I want SQ009 and 10 to appear as headers for the two columns. - see advice for  forums.limesurvey.org/forum/can-i-do-thi...oice-question#211550
Any help gratefully received 
I attach my bad effort to reproduce this display. 

File Attachment:

File Name: limesurvey...4882.lsq
File Size:24 KB
 

File Attachment:

File Name: limesurvey...4882.lsq
File Size:24 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258374 by Joffm
Hi,
please, neither provide lsq nor lsg exports.
These are language sensitive and can only be imported into a survey with the same base language.
So only provide lss exports.

Joffm

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

Please Log in to join the conversation.

  • greenwoodtree
  • greenwoodtree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258394 by greenwoodtree
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Sorry. My survey is bilingual and I don't seem to be able to export .lss. However, it makes me realise this is why I cannot import an lss question example into my survey. i will try to do that from a dummy monolingual survey and get back to you if I am still having a problem if I may. Thanks for help.

Please Log in to join the conversation.

  • greenwoodtree
  • greenwoodtree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258397 by greenwoodtree
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Actually, I cannot import .lss into a new monolingual survey either. I seem to have misunderstood something. Apologies. But how do I export/import lss files when my survey software asks for lsq?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258399 by tpartner
Please read the manual about exporting a survey - manual.limesurvey.org/Surveys_-_introduction#Export_a_survey

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.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258412 by Joffm
As @tpartner,
Or use the big button here
 

I cannot import .lss into a new monolingual survey either

Of course not.
Into a Survey you only can import groups or questions.
You can't import a survey into a survey.
Always remember the naming:
lsq: LimeSurveyQuestion
lsg: LimeSurvyGroup
lss: LimeSurveySurvey
lsa: LimeSurvyArchive

Joffm

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

Please Log in to join the conversation.

  • greenwoodtree
  • greenwoodtree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258415 by greenwoodtree
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Many apologies! I have forgotten the basics I see. Sorry to waste your time- I do appreciate this is voluntarily given and I have benefitted in the past. (One sometimes gets too stressed and fixated on issues and forgets the basic checks.)

Please Log in to join the conversation.

  • greenwoodtree
  • greenwoodtree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258441 by greenwoodtree
Replied by greenwoodtree on topic Create column headers - multiple choice questions
 

File Attachment:

File Name: limesurvey...7977.lss
File Size:33 KB
I have exported the question I am attempting to code within a dummy survey (.lss)

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258443 by Joffm
Hi,
there are some options:

1. Header as part of subquestion list (as your example)
Code:
<script charset="utf-8" type="text/javascript">
  $(document).ready(function() {
    $( '#question{QID} .question-item:eq(0)').addClass('hide-pseudo-elements').find('input.checkbox').remove();
    $( '#question{QID} .question-item:eq(5)').addClass('hide-pseudo-elements').find('input.checkbox').remove();
  });
</script>
 
<style type="text/css">
.hide-pseudo-elements label::before,
.hide-pseudo-elements label::after
  {
    display: none;
  }
</style>

2. With added new headers
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() { 
        var SubHeading1="<strong>Land owned/leased by you</strong>";
        var SubHeading2="<strong>Adjacent land</strong>";
        var thisQuestion = $('#question{QID}');
         // Insert sub-headings
        $('.checkbox-item:eq(0)', thisQuestion).before('<li class="inserted-sub-heading"><span>'+SubHeading1+'</span></li>');
        $('.checkbox-item:eq(4)', thisQuestion).before('<li class="inserted-sub-heading"><span>'+SubHeading2+'</span></li>');
    });
</script>

 
 

File Attachment:

File Name: limesurvey...7977.lss
File Size:49 KB

And please, do not hardcode things like SGQ-codes; use the variables
{SGQ}
{SID}
{QID}
...


Joffm

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

Please Log in to join the conversation.

  • greenwoodtree
  • greenwoodtree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258446 by greenwoodtree
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Thank you so much for your help, Joffm! I really appreciate this. I will use Option 2 as I think it is exactly what I want (Option 1 i guess would require me to disable the checkbox not just hide it in case people hover over and check it). I really love working with Limesurvey and shout-out to all you volunteers for helping us non-coders.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose