Adding more than 10 questions to your Quiz

You are here:

By the default, Advisor Quiz has a limit of 10 questions per quiz. This can be changed in the plugin settings, in the ‘Advanced’ tab, where you’ll find the option ‘Maximum Number of Questions’.

The reason the limit is set to 10 by default is to prevent the ‘max input vars’ PHP error.

The PHP variable ‘max_input_vars’ was introduced in PHP 5.3.9+ as a security measure to limit the maximum amount of POST variables submitted, by default this limit is set to 1000. The quiz can have a lot of hidden fields to control the order of the questions and answers, store image data, layout options, and so many other things. If you’re building a large quiz there’s a chance the number of data entries sent to be saved exceeds 1000.

If you plan to have more than 10 questions we strongly advise you to increase the limit of ‘max_input_vars’ on server configuration to prevent errors and data being lost. The way to do this will depend on the type of server you have, but generally these approaches might work:

.htaccess Solution

Create or edit your .htaccess file and add the following line:

php_value max_input_vars 3000

Your hosting provider may not allow this to be overridden, if this doesn’t work then try one of the following options or check with your provider.

Edit your php.ini file

If you have access to your servers php.ini file (via cPanel or any other options panel, using the file browsing interface) you can open it and change the value manually. You should check if that line already exists or add it:

max_input_vars = 3000

You can check in your hosting provided knowledge base if they allow you to modify this file and how to access it.

Was this article helpful?
Dislike 0