h5p / h5p-multi-choice

10 stars 98 forks source link

HFP-3645 Fix calls to showSolutions or resetTask #157

Closed otacke closed 10 months ago

otacke commented 1 year ago

Currently, when Multiple Choice questions are subcontent and the parent content does not attach Multiple Choice content when instantiating, but dynamically as needed like Interactive Book, calls to the Question Type contract functions showSolutions and resetTask will crash Multiple Choice. That's because Multiple Choice assumes that it's DOM elements have already been attached to the page, but doesn't check.

When merged in, a guard will be added to the showSolutions function and the resetTask function to prevent crashes.

otacke commented 10 months ago

Fixed by https://github.com/h5p/h5p-multi-choice/pull/164