HD Quiz

How to add a button with the text Retry

Published: December 1, 2024
Support status: closed

Hi

Thanks for a great plugin!

I asked for your new beta version but never received anything so I don’t know if my question is already part of the beta version…but after people have taken the quiz and maybe only got 7 out of 10 right I would be nice with a button labeled ‘Retry’ which users can click on to restart/retake the quiz. Is this possible and how can I do this myself? 😊

thread author: Henrik Sandberg

Henrik,
reloading the page = restarting the quiz.

Because of this, all you have to do is add a button that links back to the same page. You can do this yourself by adding the button/link to your results text.

HOWEVER, the new 2.0 has an action hdq_results_after_content which allows us to add custom content to the results area. Using this new action, we can automatically add a “restart” button to the quiz results.

Here is the code that you can add to your theme’s functions.php file. As always, make sure you have a backup of this file in case you make a mistake. You will crash your site if you copy/paste this wrong.

https://pastejustit.com/8imrxzcect

The code will add a simple link to the results that links back to the current page. You can of course rename RESTART to whatever you want, or add any classes to the link if you know the classnames that your theme uses.

This will ONLY work for the new HD Quiz 2.0, but I intend to release it tomorrow 🙂

01 December 2024 — 12:38 support admin - Dylan

Thank you for your quick answer and I hope you will send me the 2.0 version tomorrow 😊

Regards

Henrik

01 December 2024 — 12:59 thread author - Henrik Sandberg

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