Check out the LimeSurvey source code on GitHub!

jQuery script failure and survey page mis-count

More
5 years 9 months ago #60029 by danpaul000
Hi all,

I am running a survey on version 1.90 (build 9046) with all the questions on one page. I have built in several jQuery scripts that listen for a response on a checkbox and then set a radio button accordingly to whether the checkbox is checked or un-checked. See code below:
<script type="text/javascript" charset="utf-8">
 
$(document).ready(function(){
$('#question2').hide();
$('#answerSSXGGX1').change(function() { 
	if ( $('#answerSSXGGX2B').attr('checked') == true) {
		$('#answerSSXGGX2A').attr('checked', true);
	}
	else {
		$('#answerSSXGGX2B').attr('checked', true);
	} 
 
});
 
});
</script>

This script consistently works fine in all my testing. However, when other people are taking it, I notice the following issues:

- About 10% of the survey responses contain the wrong result for the script-set radio buttons.

- Any case with an incorrect value is set to the default value of the question, telling me the script most likely did not trigger at all.

- In ALL CASES where the script-set buttons are incorrect, the "Last Page Seen" value in the response export is 1. For the correct cases, this value is 2, with all the questions being on the first page, and the second/last page being the post-submission landing page.

- The majority of the surveys with "Last Page Seen" = 1 still show as complete, with an appropriate time/date stamp in the "Completed" column of the response export.

- All cases with "Last Page Seen" = 2 (with all correct answer responses) show a start and complete timestamp of the exact same time, to the second, as if all the surveys were taken in zero time. (Across multiple surveys there are different times, but each individual one shows the same time for start/finish, that is)

I think the script is straightforward enough that the issue might be one on the server, or at least on a larger scope than the individual question. I originally though the surveys might be timing out, but have since set the time-out to 18 hours and am still observing the same issue.

I know this seems very convoluted, but any advice or pointers would rock. Thanks so much!

Dan

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form