HD Quiz

Need to send invoices?
Check out my new WordPress plugin HDInvoice
Limited time launch sale

Apply the same configuration for all quizzes

Published: March 15, 2024
Support status: closed

I have created 150 quizzes. How can I apply the same configuration to all quizzes without having to configure them one by one?

thread author: JAVIER

On the other hand, what value in the database do I need to change to enable pagination for the “extras” tab of each response?

15 March 2024 — 10:50 thread author - JAVIER

Hi Javier,
it looks like you need two things. The first is you want to change the settings for all quizzes at once, and the second is that you want to enable pagination for each question?

Unfortunately, I wish you asked these questions before creating your quizzes as that would have been easier haha. But we can still work with this.

Since you are asking about modifying the database directly, I am going to assume that you would be somewhat comfortable adding some custom code to your site.

What you need to do is edit one of your quizzes to be the exact settings that you want to copy. I can then write you a function that will loop through each quiz and match the settings.

15 March 2024 — 12:12 support admin - Dylan

I’m sorry I didn’t ask before, I uploaded the quizzes massively and didn’t take this into account, lol, sorry.
I’m sorry I didn’t ask before, I uploaded the quizzes massively and didn’t take this into account, lol, sorry.

Exactly, once all the quizzes are configured, I need to enable pagination for all the questions in order to get all the quizzes the same.

I have attached an image with the settings I want to set for all quizzes, along with enabling pagination for all questions.

URL IMAGE:

View post on imgur.com

You’re very welcome!

(Please remember to enable pagination for all questions.)

15 March 2024 — 14:01 thread author - JAVIER

Just a suggestion.
This is what I use in cases like this:
Selenium IDE – usually used for testing.
You do not need to code anything.
It’s a Chrome plugin that records each change you will make to the quiz settings(for one of your quizzes).
After that, you can run that recording, and it will execute the same quiz settings, changing for each of your 150 quizzes.
It will click on the buttons you clicked, copy and paste text in text boxes, etc.

18 March 2024 — 12:32 Adrian

Have I really waited 3 days for this response? Enabling pagination for each answer using a record is absurd. It’s the same as doing it manually… I thought you would put more effort into answering this thread.

18 March 2024 — 14:22 thread author - JAVIER

Hi Javier,
the previous response was not me. It was a suggestion from another user.

As I said, I will be sending you custom code to automate all of this. Stay tuned!

18 March 2024 — 14:25 support admin - Dylan

I’m so sorry, but I’m really disappointed with the response. I thought it was you, I’m sorry.

18 March 2024 — 14:28 thread author - JAVIER

Here is a code paste for the code you will need to add to your site. https://pastes.io/2txnlqftoi

This code should be added to the start of your theme’s functions.php file, after the opening <?php tag. BACKUP THIS FILE FIRST.

This code will add two new shortcodes to your site (note, add one of the shortcodes at a time to a page, then load the page. The page will appear blank, but you can check the HD Quiz admin page to verify that it worked).

The first shortcode is hdq_set_quiz_settings and it takes one attribute quiz, which is the quiz ID of the quiz settings you want to copy.

So for example, if the quiz ID (note: you can see the quiz ID as part of the default HD Quiz shortcodes) is 34, then adding the shortcode [hdq_set_quiz_settings quiz = "34"] will loop through each of your quizzes and copy the settings from quiz 34.

I built it this way so that you can reuse this shortcode whenever you need or want to update all of your quiz settings at once.

The second shortcode is [hdq_set_all_paginate] and it keeps all questions exactly as they were, except it forces Paginate on. I also coded it in a way so that it actually doesn't enable paginate on every question. It will skip the first question in a quiz so that quizzes don't start with an extra "next" button.

18 March 2024 — 15:03 support admin - Dylan

It works perfectly. I really appreciate your help. You are a great help!

I’m really grateful for your support.

21 March 2024 — 03:33 thread author - JAVIER

Excellent! Glad you’re up and running.

If you have the time (and haven’t already), I’d appreciate a review either on WordPress.org or Google.

21 March 2024 — 12:28 support admin - Dylan

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