Welcome to the LimeSurvey Community Forum

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

Create a likert scale but move the "not applicable" option to the right

  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
13 years 2 months ago #56011 by Mazi
This can also be done by editing the template.css of the template you are using. Check the CSS that is embedded at tpartner's javascript. It should be possible to extract it and assign it to either the whole question type or just a single (or several) question by using the question ID.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 2 months ago #56018 by tpartner
Yoy will need to use JavaScript to insert the extra column. I have already included rules to be added to template.css.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
13 years 2 months ago #56034 by Mazi

tpartner wrote: Yoy will need to use JavaScript to insert the extra column. I have already included rules to be added to template.css.

Doesn't the last column have any unique value we can use for some customized formatting (just guessing)?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
11 years 7 months ago #85624 by hugomp
Hallo
What would be the script if I want to add a spacer-column not before last but say between the third and the fourth column?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 7 months ago #85647 by tpartner
Try this:
Code:
<script type="text/javascript" charset="utf-8">
 
    $(document).ready(function() {
 
    var qID = QQ;
 
    // Reset column widths
    $('#question'+qID+' col').attr('width', 'auto');
 
    // Insert new column
    $('<th class="spacerCell"></th>').insertBefore('#question'+qID+' table.question thead tr th:eq(3)');
    $('#question'+qID+' table.question tbody tr').each(function(i) {
      $('td:eq(3)', this).addClass('lastCell');
    });
    $('<td class="spacerCell"></td>').insertBefore('.lastCell');
 
 
  });
 
</script>

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
11 years 7 months ago #85678 by hugomp
Yes, many thanks.
I got it that far.
However, I do not understand why reset all column widths?
I want to keep the original column widths and only set the witdth of the spacer-column.
The indicated extra CSS does not seem to manage it.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 7 months ago #85679 by tpartner
You cannot keep the original widths if adding a column. The original widths are in percentages and add to 100 so adding a column wrecks that.

The posted CSS will manage the widths if you reset them.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 2 months ago #116617 by Mazi
Did anyone recently test if this JavaScript works fine at the latest Limesurvey 2.05 version?

Is it cross-template compatible/does it work fine with the default template?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
8 years 11 months ago #120366 by mafo

Mazi wrote: Did anyone recently test if this JavaScript works fine at the latest Limesurvey 2.05 version?

Is it cross-template compatible/does it work fine with the default template?


I tried to use this JavaScript in combination with LimeSurvey 2.05+ but it did not work :(. Of course, it is also possible that I've made a mistake.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 11 months ago #120381 by tpartner
I have just tested in 2.05 without a problem.

mafo, what template are you using? Do you have any JavaScript errors?


.

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
8 years 11 months ago #120404 by mafo

tpartner wrote: I have just tested in 2.05 without a problem.

mafo, what template are you using? Do you have any JavaScript errors?


.


I created a new template which is probably based on the default template!? After creating the new one I only changed the things you mentioned (in template.css).
I don't get a JavaScript error but JavaScript should work since I already successfully used another script which partially randomizes answers ( manual.limesurvey.org/Workarounds:_Manip...rs_-_Array_questions ).
Do I have to use another template?
Thank you for your help!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 11 months ago #120425 by tpartner
Can you provide a link to a live test survey?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose