Answer’s mark issue
Hello,
We’ve just started using HD Quiz plugin, which looks great but we have an issue. When we want to mark an answer, it doesn’t work. It does not matter if it is a new quiz or the ones that were created.
Could you help us with this issue please ?
Thanks,
Kevin
Hi Kevin,
it’s hard to know from just a screenshot, but it looks like you might have the shortcode wrapped inside of a code block. I think that is what is causing the grey rectangle at the start of your first answer.
If you can provide a link to a quiz I can confirm what the issue is. If you are unable or unwilling to provide a link to a live quiz so that I can see, then the best advise I can give is to look at your browser console for any errors.
The console can be opened on most browsers by pressing F12 on your keyboard. You will see “HD Quiz v2.0.9 init” if HD Quiz has properly initialized.
Hello,
Thanks for your quick answer.
Here is the link of the preview of a quiz : [redacted]
Do you need it to be published on our blog in order to see what’s wrong ?
Thanks,
Kevin
Thanks for the quick response Kevin.
That is the admin link to edit the quiz – I need the published page to view the quiz – similar to the page from your screenshot. I don’t know how your site is set up, but I imagine Posts become publically viewable to your users, so I’d recommend creating the quiz as a Page instead. You can also setup a password for the page if that makes more sense for you.
Hello,
Here is the link : https://www.lacabaneajouerdecdiscount.com/quizz-avatar/?preview_id=50415&preview_nonce=0bb342be08&preview=true
Thanks,
Kevin
That link works thanks.
I can see the issue and it’s an interesting one (I’ve never come across this issue before in over 10 years!). Something on your site (presumably another plugin) is actually blocking all form interactions – likely as an anti-bot measure. This is affecting HD quiz since the quiz uses checkboxes.
Even if I add a new checkbox outside of HD Quiz, I cannot interact with it. If I disable Javascript – checkboxes become active again, so I’m 100% certain of the cause here.
Are you aware of any antibot or security plugins you may have installed? I recommend checking their settings and seeing if there is a way to exclude certain pages or sections of pages.
Looking at your sourcecode, I do not see a very obvious culprit, but I’ll keep digging, and hopefully I can be more specific on where you can look on your end.
If you were asking for challenge, here it is!
So, can I let you keep digging and find something to help us identify where the issue commes from ?
Or should we try be ourselves ?
Thanks,
Kevin
I’m getting closer. I found the script file causing the problem.
There’s… a lot of stuff in there, so It’ll take me a while to dig through. It looks like its a massive cached file that contains all of your script files together.
But a packaged bootstrap looks promising. It has a property called shouldAvoidTriggerChange and then later checks for checkboxes and radios.
Oh, that seems to be a good start.
I let you work on this. If you need any more informations, do no hesitate to contact me !
Thanks,
Kevin
This was simultaneously one of the most interesting, yet impossibly frustrating debugs I’ve ever done because I never expected this to be the answer and I wish I saw this earlier haha.
I’ll do my best to explain the issue.
Let’s start with the good news – I’ve tracked down the exact line of code that is breaking everything!
I was wrong about the previous script file. The bad code was not located there. That file contained your jQuery script, and the bad code is inside of a function that relies on jQuery – so by stopping that script, it stopped jQuery from loading, and thus the bad function from running.
So, what is the issue?
On your site you have a function that checks for when you click on a link, and then you update the target to figure out if you should open it in a modal or if it should open in the same tag.
The problem is that I lied. Above is what you want the function to do, but instead you are running the function whenever a user clicks… well – anything! The first line of that function is e.preventDefault();. What this does is tell the browser that anytime the user clicks ANYTHING on the page – do not do default behaviour (such as enabling a checkbox) and instead run your custom function, which is to check the links.
How to Fix
I don’t know how you’ve added this code to your site but A) It’s related to opening up content up in a modal (lightbox), and B) you have the code added after the document closes. Because of this, I’m guessing you (or whoever worked on the site) edited your theme’s footer.php file to add this code manually.
Updated and better code would be
var link = e.target.href;
if(!link){
return;
}
e.preventDefault();What we are doing here is checking to see if “link” actually has a target. If it doesn’t, we exit the function so that elements can function as normal.
Hello Dylan,
Thank you for all these informations.
I talked about it with our IT team. And it seems that now the issue is ok.
Have a good day,
Kevin
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