Title: Text
Last modified: November 30, 2020

---

# Text

 *  Resolved [Johan Philip](https://wordpress.org/support/users/johanvarghese/)
 * (@johanvarghese)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/text-16/)
 * Hey!
    Is it possible that a user can ask for like we ask ‘How many questions 
   do you want’ and there is a text field. They can type 10 and they’ll get 10 questions.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Harmonic Design](https://wordpress.org/support/users/harmonic_design/)
 * (@harmonic_design)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/text-16/#post-13726987)
 * Is it possible? Yes!
    Is it built-in or easy to integrate? No 🙁
 * The problem with your request is that you cannot load the quiz or any questions
   _until_ the user has entered how many questions they want to load.
 * I think that the best way to do this is with a URL parameter (`$_GET` request).
 * So, for example, if the URL to your quiz is `https://domain.com/quiz`, then changing
   it to `https://domain.com/quiz?hdq_questions=10` would tell HD Quiz to load 10
   questions from the quiz.
 * **So how to implement something like this?** If you are not a developer or willing
   to hire one, then you can’t. However, I still want to outline the following steps
   in case you are.
 * The good news is that almost everything you would need to do can be done by using
   HD Quizz’s built-in actions and hooks.
 * First, add a JavaScript function using the `hdq_after` hook. In this function,
   you will do two things. The first is you will check for the `$_GET` value.
 * If the value exists, great! If it doesn’t then we know that the user still needs
   to let us know how many questions they want to see. So if the value does not 
   exist, then we use a JavaScript function to A) hide the quiz, and B) show a form
   with an number input field for the user to enter how many questions they want.
 * Now that we have figured out how to A) allow the user to let us know how many
   questions they want, and B) created a way to check to see if they’ve entered 
   anything, the hard part is over. What we need to do now is edit HD Quiz to change
   it to use the `$_GET` value.
 * For that, edit `hd-quiz/includes/template.php` and on line `71`, we need to modify
   the `$per_page` variable. Something like this
 *     ```
       if(isset($_GET["hdq_questions"])){
           $per_page = intval($_GET["hdq_questions"]);
           $paginate = false;
       }
       ```
   
 * I hope the above makes sense and at least gets you on the right path, and please
   let me know if you need further assistance.

Viewing 1 replies (of 1 total)

The topic ‘Text’ is closed to new replies.

 * ![](https://ps.w.org/hd-quiz/assets/icon-256X256.gif?rev=2936040)
 * [HD Quiz](https://wordpress.org/plugins/hd-quiz/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hd-quiz/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hd-quiz/)
 * [Active Topics](https://wordpress.org/support/plugin/hd-quiz/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hd-quiz/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hd-quiz/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Harmonic Design](https://wordpress.org/support/users/harmonic_design/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/text-16/#post-13726987)
 * Status: resolved