- Posts: 4
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Etwas in dieser Art gibt es erst ab Version 3.x.
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); // Add a question class thisQuestion.addClass('custom-array'); // Column-specific classes $('table.subquestion-list tr', thisQuestion).each(function(i) { $('th, td', this).each(function(i) { $(this).addClass('column-'+i); }); }); }); </script>
<style type="text/css">.custom-array table.subquestion-list col { width: auto !important; } .custom-array table.subquestion-list thead .column-0 { width: 43%; } .custom-array table.subquestion-list thead .column-1 { width: 14%; } .custom-array table.subquestion-list thead .column-2 { width: 5%; } .custom-array table.subquestion-list thead .column-3 { width: 14%; } .custom-array table.subquestion-list thead .column-4 { width: 5%; } .custom-array table.subquestion-list thead .column-5 { width: 15%; } .custom-array table.subquestion-list thead .column-6 { width: 4%; } </style>
keine Aggression<br><span style="font-weight:normal;color:maroon;font-style:italic;font-size:10pt">(keine sichtbaren Zeichen<br>von Aggression)</span><br>0
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); // Define the sub-heading text strings var subHeading1 = '<span style="font-size:14pt;color:navy"><br>Wenn von Ihnen oder einem Mitglied Ihres Haushalts per Stimme korrigiert oder bestraft (ausgeschimpft, angeschrien, etc.)</span>'; var subHeading2 = '<span style="font-size:14pt;color:navy"><br>Bei direkter Annäherung eines unbekannten <b>Erwachsenen</b> während eines Spaziergangs/einer Übungseinheit an der Leine</span>'; var subHeading3 = '<span style="font-size:14pt;color:navy"><br>Teilfrage 3</span>'; var subHeading4 = '<span style="font-size:14pt;color:navy"><br>Teilfrage 4</span>'; var columnsLength = $('tr.answers-list:eq(0) > *', thisQuestion).length; // Insert the new rows $('tr.answers-list:eq(0)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading1+'</th></tr>'); $('tr.answers-list:eq(1)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading2+'</th></tr>'); $('tr.answers-list:eq(2)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading3+'</th></tr>'); $('tr.answers-list:eq(3)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading4+'</th></tr>'); // Fix up the row classes var rowClass = 1; $('table.subquestions-list tbody tr', thisQuestion).each(function(i) { if($(this).hasClass('sub-header-row')) { rowClass = 1 } else { rowClass++; $(this).removeClass('array1 array2') if(rowClass % 2 == 0) { $(this).addClass('array2'); } else { $(this).addClass('array1'); } } }); }); </script> <script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Insert the column categories $('#question{QID} table.subquestion-list thead tr:eq(0) td:eq(0)').remove(); $('#question{QID} table.subquestion-list thead').prepend('<tr class="ls-heading">\ <td rowspan="1" colspan="1" style="border-bottom:0 !important;background-color:yellow;text-align:center"></td>\ <td rowspan="1" colspan="1" style="border-bottom:0 !important;background-color:yellow;text-align:center">keine Aggression<br><span style="font-weight:normal;color:maroon;font-style:italic;font-size:10pt">(keine sichtbaren Zeichen<br>von Aggression)</span></td>\ <td colspan="3" style="border-bottom:0 !important;background-color:yellow;text-align:center">mittlere Aggression<br><span style="font-weight:normal;color:maroon;font-style:italic;font-size:10pt">(knurren, bellen,<br>Zähne fletschen)</span></td>\ <td rowspan="1" colspan="1" style="border-bottom:0 !important;background-color:yellow;text-align:center">|ernsthafte Aggression<br><span style="font-weight:normal;color:maroon;font-style:italic;font-size:10pt">(schnappt, beißt oder<br>versucht zu beißen)</span></td>\ <td rowspan="1" colspan="1" style="border-bottom:0 !important;background-color:yellow;text-align:center"></td>\ </tr>'); }); </script>
Das geschieht natürlich nicht mit der richtigen Eonstellung von "Anfangswert des Schiebereglers beim Start eingestellt".Leider berücksichtigt er dann weiterhin als Antwort die "0" in der Statistik,