Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Must answer min questions

Must answer min questions 4 years 1 week ago #89202

  • Nocktis
  • Nocktis's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hey guys! I was wondering, is it possible to set a server so that a user must answer a minimum total number of questions in order to submit the survey?

Lets say I have 50 questions spread out over 4 groups and I want them to have to answer 20 or more (in any combination of groups) in order to submit the survey. If this is possible, how might I go about doing this? Thanks!
The administrator has disabled public write access.

Must answer min questions 4 years 1 week ago #89214

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6568
  • Thank you received: 1477
  • Karma: 579
That is not possible at the server level but you should be able to use JavaScript and Expression Manager to control the display of the submit button.

Given question codes q1-q50, you could add something like this to the source of a text display question on the last page of the survey (replacing "q1, q2, q3...q50" with all of your question codes):
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		$('#movesubmitbtn').hide();
		if({count(q1, q2, q3...q50)} > 20) {
			$('#movesubmitbtn').show();
		}
	});	
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 years 1 week ago by tpartner.
The administrator has disabled public write access.
Time to create page: 0.198 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form