Moodle H5P Question Set: How to force the "Finish" button to appear on all slides?
Hello everyone,
I'm encountering an issue with the default behavior of the H5P Question Set content type within my Moodle environment, and I am looking for a solution—a hidden setting, an official workaround, or a safe code modification.
The Problem: I currently have several activities created using the H5P Question Set type. The "Finish" or "Show results" button only appears on the very last slide after the user has navigated through all the questions in the set.
What I Need: I would like the "Finish" button to be visible and functional on all slides (questions), allowing the user to end the attempt and get their score at any time, even if they have only answered the first few questions.
Is there an undocumented parameter within Moodle or H5P configuration that I can use to override the sequential nature of the Question Set?
If there is no official option, has anyone successfully implemented a JS/CSS fix (perhaps via a Moodle Custom HTML block or theme) to inject a button that simulates jumping to the final slide and clicking the results button? (I am aware of the maintenance risks associated with modifying the source code, but exploring all options).
Any guidance or implementation examples within the Moodle environment would be highly appreciated. Thank you in advance for your help!
otacke
Sat, 11/01/2025 - 23:05
Permalink
Hi, lamek!There's no setting
Hi, lamek!
There's no setting for your wish no. CSS overrides would not suffice, because the button is detached from the page, not just hidden.
There' also no simple JavaScript override, because the function that's responsible for updating the buttons' state is not exposed. I think it can be done and would not be thaaat complicated, but will require to wrap/replace (`hideButton` in H5P.Question) and to replace the finish button with your own.
I think it was cleaner if you made a case and convinced H5P Group to allow the behavior that you want.
Cheers,
Oliver