Quiz ID randomizer

closed

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?

December 28, 2024 at 1:03pmTamas

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.

30 December 2024 — 13:14support admin Dylan

This thread has either been marked as complete or has been automatically closed due to inactivity. Please consider opening a new support thread for help.