Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Must answer min questions

  • Nocktis
  • Nocktis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #89202 by Nocktis
Must answer min questions was created by Nocktis
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 topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 3 months ago - 11 years 3 months ago #89214 by tpartner
Replied by tpartner on topic Must answer min questions
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):
Code:
<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: 11 years 3 months ago by tpartner.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose