HD Quiz

Need to send invoices?
Check out my new WordPress plugin HDInvoice
Limited time launch sale

Congrats on a great plugin. I was really surprised som…

Published: September 9, 2016
Support status: closed

Congrats on a great plugin. I was really surprised someone had done a multiple choice plugin with so much configuration. One issue I am seeing is I am not able to use multiple quizzes on the same page. The first one always works, subsequent ones don’t, and when I select an answer in any quiz other than the first it actually triggers a selection in the first quiz (i.e., I select option #3 in the second quiz and the radio button for option #3 in the first quiz is selected). If I submit any quiz other than the first I am sent to a new page with the answer, etc., so I believe the JavaScript is binding to only that first one and catches the submit, while the others are not bound. Maybe this could be solved by added an id selector to each quiz and binding to it, or adding a check for multiple quizzes in the JS and if multiples are found iterating over each one?

Just for insight into why I have this: I have a client who is going to post one-question quizzes on blog posts. So if she has two or more blog posts with a quiz the second one (and any others) will not work.


This thread has been imported from harmonicdesign.ca/hd-quiz/

thread author: Dead Skunk

Hello Dead Skunk,thank you for your support of HD Quiz.

When I first developed HD Quiz, I never even considered the possibility that people would want to use more than one quiz on a page, but you are now the third person to bring it up!

You are correct that it is because the quizzes do not use unique IDs (why would they need unique IDs? People will only be using one quiz per page!). I’ll try and spend some time this weekend to push out an update that will wrap each quiz in it’s unique ID so that the jQuery will only target the correct quiz. Stat tuned!

09 September 2016 — 19:21 support admin - Dylan

Wow, thanks for the quick answer and even more for the willingness to consider a change. I’ve been a developer for 20 years and can’t count the number of times this exact thing has happened to me. But it’s far better to add a feature enhancement people ask for than to build in a lot of stuff they never need. Cheers.

09 September 2016 — 19:40 thread author - Dead Skunk

If you are enjoying HD Quiz please leave a review here on the official WordPress.org page. HD Quiz is developed by me, just some dude, and is supported and available for free. It may seem dumb, but truly nothing makes me happier than knowing that people are using and loving HD Quiz and my hard work.

This thread has either been marked as complete or has been automatically closed due to inactivity.