Welcome to the LimeSurvey Community Forum

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

Visual space between (likert type labels of) a scale and an option 'don't know'

More
4 years 10 months ago #207173 by vprovoos
(Mostly applicable to array questions) Given that it is important that respondents clearly see the difference between an answer to a question and an option 'don't know' or 'not applicable', I wondered how this can be provided in Lime survey. I do not see a possibility to 1) create an empty space between two columns; or 2) give the last column (e.g. 'don't know') a different color compared to the other columns. How can this difference between the two answer-types be made more clear in the lay-out of the question? Do people have tips to share? Thanks!
The topic has been locked.
More
4 years 10 months ago #207174 by Joffm
Like this?


with this in question text
Code:
<style type="text/css">.answer_cell_9 {
    background-color: #efefef !important;
    border-left: 2px solid #aaa !important;
}
</style>
with answer_cell_9 the answer option code.

And here you find how to define column width in arrays.
forums.limesurvey.org/forum/can-i-do-thi...rvey?start=15#186378

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, vprovoos
The topic has been locked.
More
4 years 10 months ago #207178 by holch
Well, I think that looks great, Joffm. Need to have a look at that.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: vprovoos
The topic has been locked.
More
4 years 10 months ago #207179 by vprovoos
Yes, this is how I want it to look. Thank you!
The topic has been locked.
More
4 years 10 months ago #207187 by tpartner
Maybe this would be more universal:

Code:
<style type="text/css">#question{QID} td.answer-item:last-child {
    background-color: #efefef !important;
    border-left: 2px solid #aaa !important;
}
</style>

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: vprovoos
The topic has been locked.
More
4 years 7 months ago #210597 by mcovents
This works great but is it also possible to add this code to a template so all array questions that use this template have this layout so I don't have to include this code in every array question?
I work with Limesurvey 3.15
Thanks in advance and best regards,
The topic has been locked.
More
4 years 7 months ago #210600 by Joffm
Enter this to your custom.css
Code:
.no-answer-border #question{QID} td.answer-item:last-child {
    background-color: #efefef !important;
    border-left: 2px solid #aaa !important;
}

And in each question you want to use this, enter the css class "no-answer-border".
You may name it as you like.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
4 years 7 months ago #210602 by tpartner
I'm not sure about the {QID} placeholder in custom.css. :)

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: DenisChenu
The topic has been locked.
More
4 years 7 months ago #210603 by Joffm
@tpartner
Nor am I.
You are more experienced in these things
I tried and it worked. But it was an artefact.

It really works without the "#question{QID}"
only ".no-answer-border td.answer-item:last-child".

Without class "no-answer-border"
 

with class "no-answer-border"
 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: mcovents
The topic has been locked.
More
4 years 7 months ago #210629 by mcovents
Hello,
This works, but a bit too good.
This seems to work for ALL array questions in my survey even without entering the name of the class (no-answer-border) in the CSS classes field.

Did I do something wrong?

I made an extension of the default fruity theme and named it "fruity_no-answer-border"
I added the code in the custom.css using the theme editor.
The topic has been locked.
More
4 years 7 months ago #210631 by tpartner
"no-answer-border" is not to be the theme name, it is intended to be a CSS class added to the question - www.limesurvey.org/manual/Question_type_...lass_.28css_class.29

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
4 years 7 months ago #210638 by mcovents
Sorry, my mistake.
I forgot to remove the "#question{QID}" part.
Now I have the following code in the custom.css file which works as described.

.no-answer-border td.answer-item:last-child {
background-color: #efefef !important;
border-left: 2px solid #aaa !important;
}

Thanks for your help.
The topic has been locked.
More
4 years 4 months ago #215428 by mihai.bejan
Hi Joffm,

Thank you for your valuable answers on everything. I really appreciate!
I would like to keep the column "No answer" in an array question and I was wondering if it's possible to change from "No answer" to anything you want?
That would be really helpful for me, because the "No answer" will be selected by default. I also used a source code from another topic to select the last column as default answer but it take 5-7 second until the page is loading.

Thank you!
The topic has been locked.
More
4 years 4 months ago #215439 by tpartner
Insert something like this script in the question source:

Code:
<script type="text/javascript" data-author="Tony Partner">  
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    $('#question{QID} .noanswer-text, #question{QID} .noanswer-item label').text('My text');
  });
</script>

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: phinpope
The topic has been locked.
More
4 years 4 months ago #215481 by mihai.bejan
Thank you so much!

It works perfectly.

Regards!
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose