Open mhughes2k opened 1 year ago
This is a critical problem, since in some cases, the navigation buttons are not visible (e.g. Next Card arrow in the bottom corner). Also, sometimes the iframe scrollbar is not rendered, making it impossible to proceed in the activity.
Cmp. https://moodle.org/mod/forum/discuss.php?d=442304 - potentially some moodle API change that needs to be taken care of?
My suggestion would be to add the follow line of code to https://github.com/h5p/moodle-mod_hvp/blob/stable/embed.php#L89.
$PAGE->activityheader->disable();
This disables activityheader which is a new addition in Moodle 4 and which causes extra information on top of embedded H5P content. This also removes the title and description.
This is also a problem for us. We do the following:
This used (on Moodle 3.11) to result in the object being show directly on the page one time. But now on Moodle 4.1 it duplicates - see photo below:
Anny progress on this one?
We still have same issue - no updates?
We are also faced with this issue unfortunately.
It was indirectly mentioned before but to clarify: This is about the whole activity header (completion info, description, ...?) and not just about completion info.
Independent of considering the inclusion of the activity header in the embed page a feature or a bug: The wrong sizing of the height that does not respect the additional height of the header is a bug. The static height included in the iframe tag is calculated without the header. And the h5p-resizer.js script calculates the height wrong too.
Only user applicable workaround for the wrong sizing I know of: Adjust the height for the iframe manually and don't load the resize script.
This is happening with our Moodle 4.1 mod_hvp. Our solution was to add the "forceembed" with value "div" to embed.php. This way, there weren't iframes inside iframes because the embed.php seems to itself add another iframe depending on the H5P library/content type. And having three iframe levels messed up resizing because each level adds its own h5p-resizer.js script.
So it was like
<document>
Moodle Content
<iframe embed.php Level 1>
Activity and Description
<iframe embed.php Level 2>
H5P Element
</iframe>
h5p-resizer.js
</iframe>
h5p-resizer.js
</document>
Maybe even more resizers ;-) And they probably messed each other up.
Other proposed solutions include removing the activity header on Moodle >= 4.0 when embed.php is used.
Which could be nice, but there are always people who add a H5P Element in a hidden activity and then choose to embed this activity/element in another label/page/whatever. And then they add a description with a manual to the activity or embed videos explaining the activity into the description.
Which then makes hiding the header a no-go.
This is happening with our Moodle 4.1 mod_hvp. Our solution was to add the "forceembed" with value "div" to embed.php. This way, there weren't iframes inside iframes because the embed.php seems to itself add another iframe depending on the H5P library/content type. And having three iframe levels messed up resizing because each level adds its own h5p-resizer.js script.
So it was like
<document> Moodle Content <iframe embed.php Level 1> Activity and Description <iframe embed.php Level 2> H5P Element </iframe> h5p-resizer.js </iframe> h5p-resizer.js </document>
Maybe even more resizers ;-) And they probably messed each other up.
Our solution is messing up H5P Timelines, so it isn't the way to go. Force embedding a timeline in a div seems to break the timeline javascript somehow.
Note: The timeline library also explicitly requests to be embedded in an iframe. Our solution was only tested with an Accordion, which didn't have problems.
We've currently switched from our old fix which broke timelines to using the pull request at https://github.com/catalyst/moodle-mod_hvp/pull/46/files.
This disables the activityheader, but at least the h5p elements now all seem to work embedded and non-embedded.
EDIT: We had to reintegrate the pull request from https://github.com/catalyst/moodle-mod_hvp/pull/23 because even with the disabled activity header, there was a race condition as to if the vertical resizing was working or not.
It appears that under Moodle 4, the activity completion information is written out to the embed.php page:
The "top" is under a Moodle 4 theme, below is under same theme on Moodle 3.
This causes issues with the embedding as the completion statement causes the page to be longer than the actual H5P content