Correct answer not being shown

Created on 16 March 2022, over 3 years ago
Updated 18 July 2025, 3 months ago

Problem/Motivation

Correct answer not being shown on submission of answer, while correct answer + correct description is given.

Steps to reproduce

Create a quiz with Quiz Wizard Page, add a Webform Quiz Radios question, assign correct answer, set correct answer description

Drupal 8.9.13 + Webform 6.1.2 + Webform Quiz 8.x-2.x-dev

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium pablovos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The following workarounds did help in our case (Drupal 10.5.1, Webform 6.2.9, Webform Quiz 8.x-2.1):

    Problem: In webform_quiz.module->webform_quiz_form_alter() the library is not loaded, because $form['#entity_type'] is not present.
    Workaround: Add the following hook to your custom module:

    /**
     * Attach the library webform_quiz/webform-quiz if needed
     */ 
    function YOURMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {
      //
      // ATM it seems not possible to specifically identify Webform *Quiz* forms
      if (!empty($form['#theme']) && $form['#theme'][0] == 'webform_submission_form') {
        $form['#attached']['library'][] = 'webform_quiz/webform-quiz';
      }
    }
    

    Problem: In connection with the upgrade to D10 a jQuery dependency was removed ( https://www.drupal.org/node/3158256 ).
    The JavaScript \js\webform-quiz.js hat not yet been adapted accordingly.
    Workaround: Apply the 2 following patches:

  • This is the other patch; sorry.

Production build 0.71.5 2024