Quiz Radio Buttons with immediate display of correct answer

By: Daveed Flexer | Asked: 07/27/2023
ForumsCategory: How-toQuiz Radio Buttons with immediate display of correct answer
Daveed Flexer asked 1 year ago

Hello, In multiple choice step by step quiz,

I need to highlight he correct answer immediately once a choice is made, as well as highlight the users answer if it's wrong.

That is: If they chose the wrong answer highlight their answer as wrong and highlight the correct answer.

If they chose the correct answer highlight it as correct.

Anyone know if this is possible.

[Edited]

1 Answers
Victor Font answered 1 year ago
If you know how and don't mind researching filters, the Quiz Maker add-on has 11 undocumented filters. An undocumented filter is a WordPress hook available for developers to use. But they're only useful to people that know how to read and test PHP code. The Formidable Masterminds Codex V2 has an entry for every filter found in Formidable's source code including all of Strategy 11's licensed add-ons available to an Elite license holder. The Quiz Maker add-on has 15 filters, only 4 of which are documented in the Formidable KnowledgeBase. Here's the list of all the filters in the Quiz Maker add-on: https://formidable-masterminds.com/codexv2-filter-list/?header_id=3638
Victor Font replied 1 year ago

I hope you find a filter that works for you or that someone can provide a more helpful solution. My first inkling is that you might easily solve your issue with CSS, which would require a custom jQuery/CSS solution. But then I thought that there may be an unexplored, undocumented filter, which is why I suggested you look at the Quiz Maker filters in Codex V2.

The answers aren't always forthcoming though, because of the immense growth Formidable has gone through. I've been answering questions in these forums for a long time. I am amazed at some of the requirements people have asked about in this community. Formidable is being used in some unique and innovative ways.

Those of us that regularly answer questions have a lot of hands-on experience with Formidable, but none of us know all of the answers, especially when it comes to some of the lesser documented add-ons. That means, to effectively answer a question, you either know through experience because you use the same add-on or solved a similar issue, or you research the source code.

When I test any filter, documented or not, I set up a stub function in the theme's functions.php. This technique works in FSE themes, too. I set up an add_filter and related callback in conjunction with the Kint debugger. Sometimes, I call the function directly or sometimes I let everything execute until Formidable triggers the filter.

Using Kint allows you to add breakpoints to examine variables and logic values and then halt further execution so you can examine every filter parameter and their values in detail. Understanding how and what a filter receives, manipulates, and passes through data is critical to writing hearty code that won't break unless, that is, it hits an edge case not considered in design, even if you're a debug-first developer like me.

If you need a developer's help, please see https://formidable-masterminds.com/developers-directory/

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right