Advanced Search

Search Results (Searched for: n/a)

25 Sep 2018 19:28
Replied by tpartner on topic SUM of Rated Questions

SUM of Rated Questions

Category: Can I do this with LimeSurvey?

We have no way of answering that without knowing your survey structure and question/sub-question/answer codes.

Can you attach a very small test survey?
09 Jul 2018 16:06
Replied by tpartner on topic Pop-up when editing text fields

Pop-up when editing text fields

Category: Installation & update issues

It looks like the Accessibility Checker in CKEditor

- ckeditor.com/cke4/addon/a11ychecker
- ckeditor.com/ckeditor-4/accessibility-checker/

...but I have no idea why it is being triggered.
20 Apr 2018 15:37
Replied by tpartner on topic Array where some fields hidden and not mandatory

Array where some fields hidden and not mandatory

Category: Can I do this with LimeSurvey?

I did not say "Add the No Answer option to the question", I said to add another sub-question for N/A.
20 Apr 2018 12:39
Replied by tpartner on topic Array where some fields hidden and not mandatory

Array where some fields hidden and not mandatory

Category: Can I do this with LimeSurvey?

No. A workaround would be to add a hidden "N/A" column and toggle that with JavaScript where necessary.
06 Mar 2018 16:04
Replied by tpartner on topic List with numerical input

List with numerical input

Category: Can I do this with LimeSurvey?

This will get the listeners to work in 2.06:

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){	
 
		// Identify this question
		var qID = {QID};
		var thisQuestion = $('#question'+qID);
 
		// Add some classes
		$(thisQuestion).addClass('with-exclusive-items');
		$('td.answer-item', thisQuestion).addClass('non-exclusive-item');
 
		// Loop through the last-column cells
		$('td.answer-item:last-child', thisQuestion).each(function(i) {
			varThisID = $('input[type="text"]', this).attr('id');
 
			// Add a class
			$(this).removeClass('non-exclusive-item').addClass('exclusive-item');
 
			// Hide the text input
			$('td.answer-item:last-child input[type="text"]', thisQuestion).hide();
 
			// Insert checkboxes
			$(this).append('<div class="checkbox">\
								<input class="checkbox" name="" id="'+varThisID+'_cbox" value="N/A" type="checkbox">\
								<label for="'+varThisID+'_cbox" class="answertext inserted-label"></label>\
							</div>'); 
		});
 
		// Listener on the checkboxes
		$('.exclusive-item input[type="checkbox"]', thisQuestion).on('change', function(e) {
			var thisRow = $(this).closest('tr.subquestions-list');
			var thisCell = $(this).closest('td.answer-item');
			if($(this).is(':checked')) {
				$('input[type="text"]', thisCell).val('1');
				$('.non-exclusive-item input[type="text"]', thisRow).val('');
			}
			else {
				$('input[type="text"]', thisCell).val('');
			}
 
			// Fire Expression Manager
			$('input[type="text"]', thisRow).each(function(i) {
				$(this).trigger('keyup');
			});
		});
 
		// Listener on the text inputs
		$('.non-exclusive-item input[type="text"]', thisQuestion).on('keyup change', function(e) {
			var thisRow = $(this).closest('tr.subquestions-list');
			if($.trim($(this).val()) != '') {
				$('.exclusive-item input[type="checkbox"]', thisRow).prop('checked',false);
				$('.exclusive-item input[type="text"]', thisRow).val('');
			}
 
			// Fire Expression Manager
			$('.exclusive-item input[type="text"]', thisRow).trigger('keyup');
		});
	});	
</script>
05 Mar 2018 13:35
Replied by tpartner on topic Array filter between Scale 1 and Scale 2 in Dual Matrix

Array filter between Scale 1 and Scale 2 in Dual Matrix

Category: Can I do this with LimeSurvey?

Something like this will give a default answer of "A4" in the scale-1 drop-downs:

// Default answers in Scale 1
var defaultAnswer = 'A4';
$('select[id$="_0"]', thisQuestion).each(function(i) {
	if($(this).val() == '') {
		$(this).val(defaultAnswer);
	}
});

So, the whole script would look like this:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		// Default answers in Scale 1
		var defaultAnswer = 'A4';
		$('select[id$="_0"]', thisQuestion).each(function(i) {
			if($(this).val() == '') {
				$(this).val(defaultAnswer);
			}
		});
 
 
		// Identify the "exclusive" answer(s) in scale one
		// Multiple answers separated by commas are possible
		var exclusiveValues = ['A4','A5'];
 
		// Hide the "N/A" option in scale 2
		// Set this to false if you want that option always visible
		var hideNA = true;
 
		// Identify the "N/A" value in scale 2
		var naValue = $('select[id$="_1"]:eq(0) option:last', thisQuestion).attr('value');
 
		// A function to handle the drop-down behaviour
		function handleSelects(thisSelect) {
			var selectVal = $(thisSelect).val();
			var thisRow = $(thisSelect).closest('tr');
			var exclusive = false;
			$.each(exclusiveValues, function(i, val) {
				if(selectVal == val) {
					exclusive = true;
				}
			});
			if(exclusive == true) {
				if(hideNA == true) {
					$('select[id$="_1"] option[value="'+naValue+'"]', thisRow).toggleOption(true);
				}				
				$('select[id$="_1"]', thisRow).val(naValue).prop('disabled', true);
			}
			else {
				$('select[id$="_1"]', thisRow).prop('disabled', false);
				if(hideNA == true) {
					$('select[id$="_1"] option[value="'+naValue+'"]', thisRow).toggleOption(false);
				}				
			}
		}
 
		// Listener on the drop-downs
		$('select[id$="_0"]', thisQuestion).on('change', function(e) {
			handleSelects($(this));
		});
 
		// Initial states
		$('select[id$="_0"]', thisQuestion).each(function(i) {
			handleSelects($(this));
		});
 
		// On submit
		$('#ls-button-submit').on('click', function(e) {
			$('select[id$="_1"]', thisQuestion).prop('disabled', false);
		});
	});
 
	$.fn.toggleOption = function(show) {
		jQuery(this).toggle(show);
		if(show) {
			if( jQuery(this).parent('span.toggleOption').length)
				jQuery(this).unwrap();
		} else {
			if(jQuery(this).parent('span.toggleOption' ).length == 0)
				jQuery(this).wrap( '<span class="toggleOption" style="display: none;" />');
		}
	};
</script>
01 Mar 2018 14:48 - 01 Mar 2018 14:49
Replied by tpartner on topic Array filter between Scale 1 and Scale 2 in Dual Matrix

Array filter between Scale 1 and Scale 2 in Dual Matrix

Category: Can I do this with LimeSurvey?

No, that code only works for radio inputs.

This will do the trick for array-dual-scale questions using drop-downs in version 3.4.x.

(I have added the facility to hide or show the "N/A" option in the second scale)

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		// Identify the "exclusive" answer(s) in scale one
		// Multiple answers separated by commas are possible
		var exclusiveValues = ['A4','A5'];
 
		// Hide the "N/A" option in scale 2
		// Set this to false if you want that option always visible
		var hideNA = true;
 
		// Identify the "N/A" value in scale 2
		var naValue = $('select[id$="_1"]:eq(0) option:last', thisQuestion).attr('value');
 
		// A function to handle the drop-down behaviour
		function handleSelects(thisSelect) {
			var selectVal = $(thisSelect).val();
			var thisRow = $(thisSelect).closest('tr');
			var exclusive = false;
			$.each(exclusiveValues, function(i, val) {
				if(selectVal == val) {
					exclusive = true;
				}
			});
			if(exclusive == true) {
				if(hideNA == true) {
					$('select[id$="_1"] option[value="'+naValue+'"]', thisRow).toggleOption(true);
				}				
				$('select[id$="_1"]', thisRow).val(naValue).prop('disabled', true);
			}
			else {
				$('select[id$="_1"]', thisRow).prop('disabled', false);
				if(hideNA == true) {
					$('select[id$="_1"] option[value="'+naValue+'"]', thisRow).toggleOption(false);
				}				
			}
		}
 
		// Listener on the drop-downs
		$('select[id$="_0"]', thisQuestion).on('change', function(e) {
			handleSelects($(this));
		});
 
		// Initial states
		$('select[id$="_0"]', thisQuestion).each(function(i) {
			handleSelects($(this));
		});
 
		// On submit
		$('#ls-button-submit').on('click', function(e) {
			$('select[id$="_1"]', thisQuestion).prop('disabled', false);
		});
	});
 
	$.fn.toggleOption = function(show) {
		jQuery(this).toggle(show);
		if(show) {
			if( jQuery(this).parent('span.toggleOption').length)
				jQuery(this).unwrap();
		} else {
			if(jQuery(this).parent('span.toggleOption' ).length == 0)
				jQuery(this).wrap( '<span class="toggleOption" style="display: none;" />');
		}
	};
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...3-01.lss
File Size:23 KB
24 Feb 2018 14:36
Replied by tpartner on topic Relevance equation - Date higher than X & Question Answer is Y

Relevance equation - Date higher than X & Question Answer is Y

Category: Can I do this with LimeSurvey?

It's impossible for me to give an equation code example without knowing your survey set-up and question/answer codes but here is a sample survey that should give you the idea.

Selecting the first option in Q1 and Q2 will result in a warranty period of 30 days, all other combination of selections result in 60 days.

File Attachment:

File Name: limesurvey...6928.lss
File Size:16 KB
Displaying 1 - 8 out of 8 results.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!