H5P embedding issues Moodle 4.1

H5P embedding issues Moodle 4.1

by Susan Hanisch -
Number of replies: 9

I have upgraded to Moodle 4.1 Here is just one of the millions of issues I have to find a way to fix now.
This one concerns issues with embedding H5P activities (hvp plugin) in any html box.

The original activity description is automatically added at the top of the embedded activity (this was not the case with Moodle 3.x). I do not want the description to show as it is not relevant to students.

There is something not working with the sizing of the activity frame.  No matter what I do for "width" and "height", it cuts off the activity at a certain height, and users can't see the lower part of the activity including the "Check" buttons. An additional "style="width: ; height: ;" is added to the original embed code. That html code also always falls back to a certain height number (here: 527px). Example:

<iframe src="URL" width="100%" height="1200" frameborder="0" allowfullscreen="allowfullscreen" title="XXX" style="width: 100%; height: 527px;"></iframe> 


Average of ratings: Useful (1)
In reply to Susan Hanisch

Re: H5P embedding issues Moodle 4.1

by eric FALCON -

One of my clients has the same problem of displaying the summary on top of the activity;

For now, the only solution I have found, but not tested, is to modify the SCSS code of the site (at presentation level, theme, custom SCSS theme option, add the rule

.mod_introbox {
display: none;
padding: 10px;
}

In reply to eric FALCON

Re: H5P embedding issues Moodle 4.1

by Susan Hanisch -
Hi Eric,
yes, I have already added such code for H5P and other activities (forum, questionnaire, scheduler) that show the activity description twice on the actual activity page (it's also been reported here).
But that SCSS code does not apply to the issue I am referring to. It's about that the activity description is automatically added in the cases where I embed the H5P activity in an iframe, along with the tag "complete the activity". I don't want the description to appear in these cases, and it started doing it after upgrading to 4.1.
Anyway, I have my IT student assistant trying to figure this out now.

Here is a screenshot of what I mean (this is the top of an embedded H5P activity, with the description appearing at the top): 


In reply to Susan Hanisch

Re: H5P embedding issues Moodle 4.1

by Karen Searle -
I am having the same issue. The "Complete the activity" information is included in the H5P embed and seems to be causing the size of the frame to be too small for the H5P activity. The bottom of the activity is cutoff and no matter what I do with the sizes in the embed code, it doesn't change. (Also since Moodle 4.1 upgrade)


In reply to Susan Hanisch

Re: H5P embedding issues Moodle 4.1

by Susan Hanisch -
Still looking for a solution to this problem. Here is an example of embedding the H5P activity in wordpress that shows the problem (sometimes it loads and shows the full activity, on reloading it cuts it off again)
It appears that this thread is about the same problem https://moodle.org/mod/forum/discuss.php?d=439612
but for me it only started happening when updating to Moodle 4.1
In reply to Susan Hanisch

Re: H5P embedding issues Moodle 4.1

by Oliver Tacke -
The reason why the sizing is off in your case most likely is that the H5P content iframe is put into another iframe (of whatever that is wrapping the H5P content - the extra "Complete the activity" stuff should not be part of H5P but of something else). The outer (root) iframe doesn't know about the resizing of the inner iframe and hence doesn't resize itself to make enough room for the inner iframe.
In reply to Oliver Tacke

Re: H5P embedding issues Moodle 4.1

by Susan Hanisch -
Hi Oliver,
thanks for your response. The H5P content is embedded from a Moodle activity (hvp plugin), so that is the problem. The same happens in Moodle when I embed H5P content there. Must be something about the plugin. Just installed the newest version of the plugin but the problem is still there... I posted the problem here, on the H5P forum, on the plugin page ...
In reply to Susan Hanisch

Re: H5P embedding issues Moodle 4.1

by Oliver Tacke -
Sorry, I have not used moodle in ages and at least earlier versions of the H5P plugin did not add that extra piece of information on top of the actual H5P content. If it now does, then the plugin may indeed need to be fixed.
In reply to Susan Hanisch

Re: H5P embedding issues Moodle 4.1

by Dave Foord -
Picture of Particularly helpful Moodlers
I believe this issue is also connected to the one that is reported here: https://moodle.org/mod/forum/discuss.php?d=449095 this is clearly a problem, but what I cannot work out is whether this is something that needs to be fixed by H5p or by Moodle
In reply to Dave Foord

Re: H5P embedding issues Moodle 4.1

by Susan Hanisch -
Hi Dave,

indeed this seems similar (thought in the thread they are reporting the problem with the normal activity in the mobile app version). One suggestion in the thread regarding the embedding is "You can go to the HTML code of your activity page, and put the H5P div into another div with a min-height style property set. This should do the work..." Not sure if that would fix the problem here, since the code is already adding additional height and width in the iframe.

Anyway, it seems that within Moodle I can mostly get it to work alright if I go into the HTML code, then change the width to 100% both times and adjust the height to whatever I need both times, e.g.
And then I click Save WITHOUT leaving the html mode. (If I leave html mode before saving, it just reverts back to some other height value in the second instance which cuts the activity off)