Changes in H5P.MultiChoice 1.16 cause broken buttons in H5P.QuestionSet 1.20
We recently upgraded our Moodle site (to version "5.0.7+ (Build: 20260427)", release "2025041407.01"), which included an upgrade in its h5p library from v127 to v128. To be clear, there's a related Moodle tracker bug about issues that caused for some sites, due to this changing which H5P library versions were pulled in, and Moodle potentially not clearing its cached dependency graphs correctly. ( https://moodle.atlassian.net/browse/MDL-88637 ). But this bug report is about a separate, related issue. After the upgrade, and after fixing the dependency graphs issue, we found that we have a number of Question Set activities (H5P.QuestionSet 1.20) that now have broken "next" / "previous" buttons. See the attached file buttons.jpg for a screenshot of this.
The buttons problem can be manually fixed by upgrading the H5P module to QuestionSet 1.21, but that wasn't feasible for us because we have sites with several hundreds of these, and in Moodle the only way to upgrade them would be through the web interface, opening and re-saving each one. This is partly because the QuestionSet 1.21 upgrade includes executable JS code (an "upgrade.js" file).
So, in search of another fix, I dug down to find the actual cause of the bug. It turns out, it's a change in the dependency H5P.MultiChoice, introduced somewhere between versions 1.16.6 and 1.16.27. This changed was marked as a patch change only, which means it should be 100% backwards compatible. But, it inadvertently introduced an API change which makes it non back-compatible.
Specifically, it's this line in the H5P.MultiChoice constructor function (line 59 or multichoice.js):
> H5P.Question.call(self, 'multichoice', { theme: true });
Passing "{theme: true}" to H5P.Question changes how its ".addButton()" function works, so that it generates the buttons using H5P.Components.Button instead of JoubelUI.createButton(). And crucially, H5P.Components.Button requires different parameters be passed to ".addButton()", such as a text label and a different way of specifying an icon.
The code in QuestionSet 1.21 passes the correct parameters for H5P.Components.Button, but the code in QuestionSet 1.20 does not, which results in those weird, shrunken, empty buttons.
I'm not sure what the best fix would be for this, in terms of semnatic versioning. I originally wrote here that it would make sense to do a new patch version of H5P.MultiChoice 1.16 that doesn't pass "theme" to H5P.Question; and do a new minor release (1.17) that does. But actually, H5P.MultiChoice is also a full content type on its own, and doing this would change the appearance of those buttons in existing H5Ps that use it as their primary content type, which would just lead to a new bug.
Maybe you could put a code workaround in H5P.Question.addButton()? Perhaps it could detect this situation when the "text" param is an empty string and the "extras" param does not provide an icon; and in that case call JoubelUI.createButton() instead of H5P.Components.Button.
Replication instructions:
I've attached some sample H5P modules that you can replicate the issue with. One of them has an H5P.QuestionSet 1.20 activity with H5P.MultiChoice 1.16.6. The other has an H5P.QuestionSet 1.21 activity with H5P.MultiChoice 1.16.27; uploading it will cause Moodle to update its version of H5P.MultiChoice 1.16 from 1.16.6 to 1.16.27.
- Do a clean install of Moodle 5
- Create a course.
- In the course editing tabs, go to "More -> Content Bank"
- Upload the file "QuestionSet1-20_MultiChoice1-16-6.h5p"
- View the created H5P, and verify that the next/previous buttons render correctly. (They will display with arrow icons rather than text labels. This is correct behavior.)
- Upload the file "QuestionSet1-21_MultiChoice1-16-27.h5p" (or run the scheduled task "Download available H5P content types from h5p.org")
- View the first H5P again
Expected result: Its next/previous buttons continue to display unchanged.
Actual result: Its next/previous buttons display as small rectangles with no text label or icon.
aaronw
Wed, 05/13/2026 - 04:49
Permalink
A hacky workaround
In the meantime, as a workaround I've made a modified version of H5P.QuestionSet 1.20 with a higher patch number (1.20.101), which provides hard-coded English-language labels for the "next"/"previous" buttons. I've uploaded that into our affected sites, and it ensures that the buttons display with labels rather than being completely blank.
I've attached the file here for others who are affected by this issue, and have too many H5P modules for the editor re-save to be a feasible approach.
But use caution, because Moodle does not provide a way to roll back to earlier H5P library versions, so if you upload this you will not have an easy time undoing it should you need to. And as mentioned, I didn't take the effort to make these labels translatable; they're hard-coded to "Next" and "Previous". So if your site is in a different language, you probably do not want to upload this module. (That said, it will only affect QuestionSet 1.20 instances. Newly created QuestionSet modules will use version 1.21 and be unaffected.)
BV52
Wed, 05/13/2026 - 18:24
Permalink
Hi aaronw,Thank you for
Hi aaronw,
Thank you for reporting this issue. We are aware of this issue and the Develpment team is already finding a resolution for it. However, we do not have a timeline when it will be resolved.
-BV
HeleneH
Sun, 05/17/2026 - 12:52
Permalink
Bug in content type - buttons
Anyone with an online training business is impacted... Thanks to the H5P team for picking this up and please do post news/updates on the resolution of this issue, so that we may know what next step needs to be implemented.
otacke
Wed, 05/13/2026 - 23:46
Permalink
The neglection of proper
The neglection of proper version bumping (even though a warning was issued beforehand) has caused lots of trouble with multiple H5P content types and different H5P integrations. I sincerely hope that H5P Group learned from this mistake.