Ask the community, share ideas, and connect with other LimeSurvey users!
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.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var qID = '{QID}'; var thisQuestion = $('#question'+qID); /****** HEADER ROWS ******/ // Find the header rows var headerRowPrefix = 'h'; var headerRows = $('li[id^="javatbd"]', thisQuestion).filter(function() { return $(this).attr('id').includes('X'+qID+headerRowPrefix+''); }); // Loop through the header rows $(headerRows).each(function(i) { // Assign a class name $(this).addClass('inserted-header-row') // Move the label .prepend($('label.control-label:eq(0)', this)) // Remove unecessary elements .find('input, div').remove(); }); /****** ANSWERS INTO COLUMNS ******/ // Number of columns to display (max 4) var columns = 4; thisQuestion.addClass('with-inserted-columns columns-'+columns+''); /****** REMOVE SOME TEXT INPUTS ******/ // Find the rows to keep text inputs var textRowPrefix = 'oth'; var textRows = $('li[id^="javatbd"]', thisQuestion).filter(function() { return $(this).attr('id').includes('X'+qID+textRowPrefix+''); }); // Remove text inputs from all except those rows $('li[id^="javatbd"]', thisQuestion).not(textRows).find('div.text-item').remove(); }); </script>
<style type="text/css" data-author="Tony Partner"> li.inserted-header-row { float: none; clear: both; flex: 0 0 100%; } li.inserted-header-row label { padding-left: 15px; padding-right: 15px; font-weight: bold; } li.inserted-header-row label::before, li.inserted-header-row label::after{ display: none; } @media only screen and (min-width: 768px) { .with-inserted-columns ul.ls-answers { display: flex; flex-flow: row wrap; } .with-inserted-columns ul.ls-answers li { margin: 0 0 1em 0; padding: 0 15px 0 0; } .with-inserted-columns.columns-2 ul.ls-answers li { flex: 0 0 50%; } .with-inserted-columns.columns-3 ul.ls-answers li { flex: 0 0 33%; } .with-inserted-columns.columns-4 ul.ls-answers li { flex: 0 0 25%; } .with-inserted-columns ul.ls-answers li.inserted-header-row { flex: 0 0 100%; padding: 0; } .with-inserted-columns ul.ls-answers li > div { float: none; width: auto; } .with-inserted-columns ul.ls-answers li label { text-align: left; } .with-inserted-columns ul.ls-answers li input[type="text"] { margin-top: 0.25em; } } </style>
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var SubHeading1="Subquestions 1-3"; var SubHeading2="Subquestions 4-6"; var SubHeading3="Subquestions 7-8"; var thisQuestion = $('#question{QID}'); // Insert sub-headings $('.question-item:eq(0)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading1+'</span></li>'); $('.question-item:eq(3)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading2+'</span></li>'); $('.question-item:eq(6)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading3+'</span></li>'); }); </script>
<style type="text/css">.myHeader { color:maroon; font-size:120%; background-color:#F8F8FF; border:1px solid #ccc; padding: 1px 5px; } .inserted-sub-heading { margin-bottom:12px; } </style>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('.checkbox-text-item:eq(0) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(1) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(3) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(4) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(6) .comment-item', thisQuestion).remove(); }); </script>
Please Log in to join the conversation.