• Resolved sg2211

    (@sg2211)


    Firstly, what an awesome plugin HD Quiz is. I have tried a lot of quiz plugins and this is by far the best and easiest to use.

    In terms of SEO, the quiz pages appear to list each question twice (check how Google Crawler sees the page here: https://totheweb.com/learning_center/tools-search-engine-simulator/). Is it possible to list these just once?

    Second query – is there a way to change the default quiz settings so they don’t need to be changed for each quiz created? For example, I want to ‘Always Show Incorrect Answer Text’, ‘Immediately mark answer as correct or incorrect’, ‘Show the correct answers on completion’ for every quiz.

    Many thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Harmonic Design

    (@harmonic_design)

    Hi sg2211,
    for your first question: HD Quiz only prints each question on the page once. Period. The tool you provided is a generic third-party tool and is not 100% representative of how “Google Crawler sees the page”. Use Google Search Console for that; that is the literal way that the Google crawler views pages.

    For example, I **think** that the issue you are referring to is that the *answers* are shown as duplicated in that tool?

    HD Quiz is accessible. This means that it is usable and readable by those with vision impairment, or otherwise need to rely on accessibility tools to navigate the web.

    Since answers are interactable elements, HD Quiz needs to **announce** this to screen readers. This is done by setting something called an aria-label. The thing is that these labels (at least the way I am using them) are only visible to screen readers, and it is these labels that are being picked up by that totheweb tool.

    Long story short; you don’t need to worry! Google won’t be giving your quizzes any duplicate content penalty or anything like that.

    Here is some documentation on WCAG (accessibility standards) and aria-labels if you are interested to know more: https://www.w3.org/TR/WCAG20-TECHS/ARIA6.html

    FOR YOUR SECOND QUESTION, SETTING DEFAULT SETTINGS, there are two ways to accomplish this. The best option really depends on how you want it to work, and what the settings are that you want to change.

    However, because of your example settings, the method I will recommend is to use HD Quiz’s hdq_init filter to add a custom function to your quizzes. This custom function will change the quiz settings. This method will not ACTUALLY update the settings ? so if you look at the settings for a quiz, they will not have changed, however, when you run an actual quiz, the settings will update for the live quiz.

    Add the following code to your theme’s functions.php file (and BACKUP the file first!).

    function hdq_sg2211_update_quiz_settings($quizData)
    {
    	$quizData->hdq_show_results_now = "yes";
    	$quizData->hdq_show_extra_text = "yes";
    	return $quizData;
    }
    add_filter("hdq_init", "hdq_sg2211_update_quiz_settings", 10, 1);

    That code will run whenever a quiz runs to enable the Immediately show results, and show extra text. It will do this for all quizzes, regardless of what the original settings were.

    You can see the names of the other settings by loading up a page with a quiz, and typing the following into your browser console HDQ.VARS. Also note that you’ll probably have to clear your browser and site cache (if using a caching plugin) after making your changes.

    Sorry for the long-winded reply, and let me know if you need further help or clarifications!

    Thread Starter sg2211

    (@sg2211)

    Thanks for your reply. Your solution works great. However, I am struggling with the ‘mark_correct’ setting. I want this to be set to yes but the following code does not seem to make this happen:

    function hdq_update_quiz_settings($quizData)
    {
    $quizData->hdq_show_results_now = "yes";
    $quizData->hdq_show_extra_text = "yes";
    $quizData->hdq_share_text = "I scored %score% on the %quiz%. Can you beat me?";
    $quizData->hdq_mark_correct = "yes";
    return $quizData;
    }
    add_filter("hdq_init", "hdq_update_quiz_settings", 10, 1);

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change default quiz settings’ is closed to new replies.