Quiz ID randomizer
I am currently using the HQ Quiz plugin on a site built with Elementor. Is it possible to have the quiz IDs I created inserted randomly on the page? The goal is to create a quiz page where users encounter a different quiz each time they visit. On every page refresh, the start button for the quiz should point to a different quiz ID. For example, I would like to specify multiple shortcodes that start randomly, such as This quiz no longer exists, This quiz no longer exists, This quiz no longer exists, etc. Are you planning to implement such a feature?
Hi Tamas,
this is not something that I think will ever be included as a feature for HD Quiz.
However that does not mean that this is something that is not possible. HD Quiz is VERY easy to extend.
Here is some custom code you can add to your theme’s functions.php
file (ALWAYS BACKUP THE FILE FIRST).
https://pastejustit.com/1wikdnx9y1
This code adds a new shortcode [HDQRandom quizzes = ""]
. This shortcode accepts a new attribute called quizzes
that will contain a comma-delimited list of quiz IDs.
Example: [HDQRandom quizzes = "422,225,555,556"]
The shortcode will then randomly select one of the IDs and display the corresponding quiz. Just remember to disable any page caching you have on the page or else… the page will be cached and you will not be able to see new content every reload.
Respond to thread
This thread has been closed / marked as resolved.
You can reply to this thread, but it might be better to start a new thread if you need help.
You can also upload images to imgur and paste the links here. Just make sure that your images don't include any sensitive information.
Submit