AJAX modal edit question form can't load js

Created on 4 April 2022, over 2 years ago
Updated 26 July 2024, about 1 month ago

Problem/Motivation

In single quiz Questions tab, many actions open AJAX modals.
Sadly drupal can't load javascript in AJAX modals (nor dialog) forms.

Steps to reproduce

Enable quiz and multichoice. Multichoice uses a simple js wich auto-set "Score if chosen" to 1 or 0 changing the state of the "Correct" checkbox.

Add a multichoice question from the Questions page (without AJAX modal) to see the helper script working correctly.
Create a quiz and add a new question: the js won't work, as it's not even loaded.
Editing questions has the same behaviour.

Proposed resolution

Remove the modal options and use destinations instead.

🐛 Bug report
Status

Active

Version

7.0

Component

Code - Quiz core

Created by

🇮🇹Italy nessunluogo Tremestieri Etneo (CT)

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.

Production build 0.71.5 2024