Welcome, Guest
Username: Password: Remember me

TOPIC: Must answer min questions

Must answer min questions 1 year 9 months 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.

Re: Must answer min questions 1 year 9 months ago #89214

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4195
  • Thank you received: 789
  • Karma: 359
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 1 year 9 months ago by tpartner.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.098 seconds
Donation Image