Great plug-in, excellent job, Dylan. Many congratulations…

closed

Great plug-in, excellent job, Dylan. Many congratulations!
As I answer the quiz, my responses must be stored in cache. Could you point me to where these are stored, so I can attempt to write my own code to give weighted scores for now (until your elegant solution comes along, that is) 🙂
Thanks a ton for the help!

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

April 21, 2020 at 4:34amMadhav

Hi Madhav,
Instead of “cache”, I assume you mean “database”?

HD Quiz does not store or save anything a quiz taker submits, but there is the free HD Quiz Save Results Light addon that stores some basic information.

However, updating HD Quiz to be compatible with weighted questions is not something easily done! If you are a developer, I reccomend using the hdq_submit action. What this does, is tell HD Quiz to run a javascript function of the same name as well as send quiz data to wp-ajax.php so you can do whatever you want with it.

Example.

// Tell HD Quiz to send an AJAX request to `hdq_madhav_submit_action()`
// once quiz has been submitted
function hdq_madhav_submit($quizOptions)
{
    array_push($quizOptions->hdq_submit, "hdq_madhav_submit_action");
    return $quizOptions;
}
add_action('hdq_submit', 'hdq_madhav_submit');

// the functon that runs once quiz submitted function hdq_madhav_submit_action($data) { // do something with submitted $data }

I hope hat helps get you started!

21 April 2020 — 10:28support admin Dylan

Many thanks, Dylan.
I can get going with this. That is a HUGE help, very very quickly given!!!!
You are amazing!

This thread has either been marked as complete or has been automatically closed due to inactivity. Please consider opening a new support thread for help.