crashing on new Quiz only
-
HD Quiz : version 1.8.10
WP : version 6.4.1- the 1.8.10 version is marked as ‘not compatible’ with vesion 6.4.1
- Got several quiz (14) on pages, one per page. all are working fine.
- Adding a new one, makes the public page crash (error500) on only the new page where the new quiz is.
- is there a limit of quiz on the free version?
any clue?
-
Hi fakokay,
don’t worry about the compatibility. It is fully compatible with all WordPress versions > 5. It was just bad timing that WordPress released v6.4.1
within hours of me releasing1.8.10
so I never updated the compatibility record.There is also no limit to how many questions or quizzes you can have.
If existing quizzes work, and it’s only the new one that fails, we need to figure out what makes the new one different.
Some things to try
- You say it only has issue when you publish the page. Are you using a page builder? What happens if you create a brand-new page and only put a quiz on it? If that works, then we know the issue is with the page and not with the quiz.
- Also, when you say only when you make “public” does this mean that it does not crash if you preview the post as a draft?
- What about if you create a new simple quiz to test? Just a new quiz with a single multiple choice question. Does that crash? This can help narrow down if there is an issue with your new quiz.
- You can also enable
WP_DEBUG
to see if your site spits out an error message. This can help track down where the issue originates from. Here is an article I wrote with steps.
https://hdplugins.com/learn/wordpress/wordpress-debug-steps/
Hi again,
- i’ve created a new page with a new quiz. it’s displaying only the “Finish” button with no question.
- i’ve also turn DEBUG to True, nothing is displayed.
- I’ve selected am old quizz… it’s working fine.
- Yes, i’m using Guttenburd.
- i was using your dropdown menu to select the test quiz, but even using as a raw shortcode ([HD quizz id=”000″]) it just displaying the “finish” button only.
- it’s not crashing anymore (error500), but it’s still not working.
regards,
i found thoses error on our internal errorlogs (different of the errorlogs from the server, that may help).
[2023-11-24 08-27-20] Warning: Undefined array key “answers” in \plugins\hd-quiz\includes\meta.php:990
[2023-11-24 08-27-20] Warning: Trying to access array offset on value of type null in \plugins\hd-quiz\includes\meta.php:990
[2023-11-24 08-27-20] Warning: Undefined array key “question_type” in \plugins\hd-quiz\includes\meta.php:991
[2023-11-24 08-27-20] Warning: Trying to access array offset on value of type null in \plugins\hd-quiz\includes\meta.php:991
[2023-11-24 08-27-20] Warning: Undefined array key “question_type” in \plugins\hd-quiz\includes\meta.php:1007
[2023-11-24 08-27-20] Warning: Trying to access array offset on value of type null in \plugins\hd-quiz\includes\meta.php:1007
[2023-11-24 08-28-05] Warning: Undefined array key “value” in \plugins\hd-quiz\includes\functions.php:294
[2023-11-24 08-40-50] Warning: Undefined property: WP_Error::$name in \plugins\hd-quiz\includes\template.php:64- This reply was modified 1 year ago by fakokay. Reason: remove public domain paths
I can’t tell from just these messages, but I **think** that the issue is that one of your questions is corrupted.
How this happened I cannot say – it should be impossible, but perhaps your database messed up in saving, or another plugin that hooks into WordPress
meta
saving had an error, etc.According to those logs (assuming they are relevant), you have a question saved, but that question does not have any of the required metadata saved to it (no answers, not even a selected question type).
What’s weird here is that A) you created a new quiz with a single question and it still does not work, and B) it no longer crashes, but does not show the questions?
So the next steps are
- Sorry to have to ask, but for your new test quiz – the question you added was a simple multiple choice: text question, and you actually added answers to it (and selected one as the correct)?
- Assuming the above is verified, this means that on your site, a new “question” is correctly being created, but saving the question data is failing. This would almost certainly be caused by some other plugin on your site. Perhaps a security plugin, or a user permissions plugin.
- If you edit your questions, does all of the data show?
Once you go through the above, let me know if you still can’t track down the issue. I’ll reach out to you and we can perhaps do a screenshare call so I can help you debug. This is a real head scratcher for me!
well since all the others quiz are still working, this is indeed very odd.
The DB isn’t corrupted, i even perform an optimize on it.
Maybe a start of an indice, the question isn’t saved after creating a since text question with 2 options… that’s at least explain why it is not showing on the page.
The relevant error (from our custom errorlog manager) for this is : Undefined array key “value” in \domainpath\wp-content\plugins\hd-quiz\includes\functions.php line 294i’m Canadian too btw ??
line
294
is the line that attaches the question to a quiz and lives inside the main “save a question” function. It still remains to be seen if your site is unable to save all question data, or if it is only failing to attach the question to a quiz.If you go to the main HD Quiz page, and select “BULK MODIFY QUESTIONS”, you should see a list of all of your questions.
I imagine that your most recent question will be there, but will have nothing under the “Quizzes” column. If you hover it and select “quick edit”, you will be able to attach the question to one of your quizzes. Do this and see if it now works.
If it works, then we know that the issue for you is that questions are failing to attach to quizzes. If this also doesn’t work (such as question appears but has no answers, etc) then we know that the issue is that all question data is being rejected by your site.
Do you know how to use your browser console? On most browsers (I recommend a Chromium based on for this), if you press F12 it will open the browser console. Just make sure that the console tab is selected. Now when you save a question, the question data should appear in the console. See below screenshot.
If it works, you will see all of the question data appear, followed by a status message. At the very least, this can confirm that HD Quiz is correctly getting the question data and sending it your site to save. This confirms that the issue lies with your site saving data, instead of creating the data.
i’m a developper too, so yeah i can use the console. ??
i just reinstall the plugin and it’s working now. strangly… for now.
thank for your help, greatly appreciated.That’s a new one!
My best guess is that the update was corrupted somehow (perhaps a server timeout during the update or something), or possibly some kind of caching issue where reinstalling caused a flush that fixed it. ??
Glad you got it working though, I’ll mark this as complete
another error… this time it’s a missing file in your template folder (select-all-image.php).
Warning: require(\domainname\wp-content\plugins\hd-quiz\includes/templates/select-all-image.php): Failed to open stream: No such file or directory in \domainname\wp-content\plugins\hd-quiz\includes\functions.php:796i downloaded your latest version to check if the file is present… and it’s not. ??
That’s safe to ignore. Warnings are not errors ??
That’s for the new question type and the file is currently not part of the main package since I need to update the Save Results addons to be compatible with the new question type first. Luckily, this will be later today!
well… in the admin we can select ‘select_all_apply_image’ and that trigger the warning cause no file.
if this option is not fully integrated, it should not be accessible in the dropdown.
i switch to ‘multiple_choice_image’ and it’s working now.
- The topic ‘crashing on new Quiz only’ is closed to new replies.