Show current score as you progress through quiz, output list of all quizzes
I’d like to use your quiz plugin on a client site and am trying to find out if there is already functionality for a couple simple features:
We’d like to display the current score as a user progresses through the quiz. Preferably at the top of the quiz. Can the plugin do this already, or will I need to build some custom code?
We plan to launch a new quiz each week; is there a way to list out all available quizzes in the system in chronological order? It doesn’t look like the quizzes are being added in a CPT, so I am not sure if I can just write a little shortcode addon that uses a query to query all available quizzes.
Please let us know.
Thanks
hi Zach,
We’d like to display the current score as a user progresses through the quiz. Preferably at the top of the quiz. Can the plugin do this already, or will I need to build some custom code?
You will need to add custom code. Some helpful info to get you started.
Under quiz settings, enable “Immediately mark answer as correct or incorrect”. I’d also recommend using the Timer Per Question feature (even if you set the limit to a very high number) to force users to answer questions in order.
From there, you can add your custom code by using the hdq_after action to add your JavaScript to the page, and write a JS function that checks for when an input with class hdq_option changes, and then check the parent div hdq_row to see what classes were added to it (in your case, check to see if it has class hdq_correct as that means the user got the question correct). You can then use this to increase a variable and display it wherever you want.
We plan to launch a new quiz each week; is there a way to list out all available quizzes in the system in chronological order? It doesn’t look like the quizzes are being added in a CPT, so I am not sure if I can just write a little shortcode addon that uses a query to query all available quizzes.
That’s because quizzes are Taxonomies – questions are CTP. You can look under the Tools page of HD Quiz to get the link to the direct Taxonomy page. You can probably use a date_query on the taxonomy, but you’re probably better off simply using the ID to order them since the higher number will always be the most recently created.
Good luck!
Hi Dylan,
Thank you for the prompt replies. That narrows my scope significantly as you essentially just eliminated me having to pour through the plugin code to determine all this.
If you wanna shoot me your email address to [email protected], once I have everything up and running for my client, I will share the custom code I write in case you wish to utilize it in the future.
Thank you!
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