- Posts: 6
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> // A JQuery plugin to insert comments into a specified column of a normal radio array VERSION 1 (function( $ ){ $.fn.cbArrayComments3 = function(options) { var opts = $.extend( { column: -1 // Text Input column (-1 will default to last column) }, options); return this.each(function() { // Identify the questions var thisQuestion = $(this); var q1ID = $(thisQuestion).attr('id').replace(/question/, ''); var thisQuestion = $('#question'+q1ID); var nextQuestion = thisQuestion.nextAll('.multiple-short-txt:eq(0)'); var q2ID = $(nextQuestion).attr('id').replace(/question/, ''); //Hide the multiple-short-text nextQuestion.hide(); // Move the text inputs var column = $('tr.answers-list:eq(0) td.answer-item', thisQuestion).length; if(opts.column > 0) { column = opts.column; } $('tr.answers-list', thisQuestion).each(function(i) { var thisCode = $(this).attr('id').split('X')[2].split(q1ID)[1]; $('td.answer-item:eq('+(column-1)+') input[type="radio"]', this).css({ 'position': 'absolute', 'left': '-9999em' }); $('td.answer-item:eq('+(column-1)+')', this).removeClass('radio-item').addClass('inserted-text-item').append($('input[type="text"][id$="X'+q2ID+thisCode+'"]', nextQuestion)); }); }); }; })( jQuery ); $(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); }); }); $('#question{QID}').cbArrayComments3({ column: 7 // Text Input column (-1 will default to last column) }); }); </script>
<style type="text/css">.custom-array table.subquestion-list col { width: auto !important; } .custom-array table.subquestion-list thead .column-0 { width: 20%; } .custom-array table.subquestion-list thead .column-1 { width: 7%; } .custom-array table.subquestion-list thead .column-2 { width: 7%; } .custom-array table.subquestion-list thead .column-3 { width: 7%; } .custom-array table.subquestion-list thead .column-4 { width: 7%; } .custom-array table.subquestion-list thead .column-5 { width: 7%; } .custom-array table.subquestion-list thead .column-6 { width: 7%; } .custom-array table.subquestion-list thead .column-7 { width: 38%; } </style>
Please Log in to join the conversation.
Please Log in to join the conversation.
$('#question{QID}').cbArrayComments3({
column: 7 // Text Input column (-1 will default to last column)
});
Please Log in to join the conversation.
Please Log in to join the conversation.
Therefore we often recommend to display "group by group" with one question in each group"Is there a way to achieve this type of design in the question-by-question presentation style?
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Agreed, it is not,It feels not logical to me yet to put every other question separately in a group to produce this one particular design.
In this thread (I know it is very long) you find a lot of solutionsWhat script would that be?
Please Log in to join the conversation.
+ what you mentioned: Either people enter into the input field or they select a button. What script would that be?
Please Log in to join the conversation.
Please Log in to join the conversation.