H5P - embedding code does not work

H5P - embedding code does not work

by Beatriz Rojo -
Number of replies: 8

Hi there,

I have a similar problem like Laurent's. I'm using Moodle 3.5. 

I integrate several H5P activities into a book using the embedding code of the H5P activities. Some weeks ago it works, students could view and complete the activities opening and navigating through the book. But today I found out students do not see anything: not an error message, nothing, just an empty chapter:


These are the configuration I've been using:

  • I create the activity in a hidden topic named "Hidden resources"
  • The activity availability is set to "Available but not shown on course page".
As indicated in the discussions below, stealth activities are allowed and I deleted the script section of an embedding code and the result is the same.

https://moodle.org/mod/forum/discuss.php?d=401214#p1618620

https://moodle.org/mod/forum/discuss.php?d=337916#p1369844

Any hints what is the reason for that?

Thanks!

Beatriz

Average of ratings: -
In reply to Beatriz Rojo

Re: H5P - embedding code does not work

by Gemma Lesterhuis -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
hi Beatriz,

Did you check on a students account, or did you use "Login as" functionality?
Gemma
In reply to Gemma Lesterhuis

Re: H5P - embedding code does not work

by Beatriz Rojo -
Hi Gemma,
thanks for your reply. I used a student account. When I log in with my account and change the role to Student, this problem does not occur, I can see everything correctly.
In reply to Beatriz Rojo

Re: H5P - embedding code does not work

by Gemma Lesterhuis -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hmm... I just have tested the scenario on my Moodle 3.5.11 enviroment and could not reproduce it.
I have setup a book, embedded the H5P content using the embed script that the H5P provide. Hidden the activity it showed an error, made it available but not shown on course page, and it appeared again.

Since it is NOT showing an error, have you checked the INSPECT of the browser to see if there is a "hidden" element somewhere.
Sometimes plugins tend to "fight" eachother, which will give you some direction.
In reply to Gemma Lesterhuis

Re: H5P - embedding code does not work

by Beatriz Rojo -
Dear Gemma,
there was not such a bug. It is actually my view when I use the "Log in as" and "impersonate" as a student. So the problem is not H5P. Thanks for your support!
In reply to Beatriz Rojo

Re: H5P - embedding code does not work

by Gemma Lesterhuis -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I think we misunderstand each other, do you mean it being solved? (There is a bug combinatie with login as + iframe in Moodle 3.5 and higher) 

Or something else?? To be clear... 

I have rebuild what you have stated in my own Moodle 3.5.11 enviroment and was not able to reproduce the issue you present (logged in as a student and the H5P embedded item was showing in the Book). 

This said   I know - and seen - simalar issues that are caused by either a different plugin that H5P that is "out filtering" the Iframe code, and/or a Moodle core change. 

I could seen the Iframe code being "filtered" away when I did a browser inspect. 

Since you seen NO error, just a blank page. I think that it might be either a different plugin ór a filter of Moodle causing this issue. 

So I advice you: 
- To login on your student account, go to the book, and do a browser inspect and see if you noticed on the spot the iframe should been shown a class called "hidden"
 (Probably easier when you log in with your own account in a different browser, and do the same browser inspect and check if there is a difference). 

- Turning off (or maybe even filters ON) in your book activity. I found out that the Math Jax filter was the causing a conflict. 

Other option: turn debugging on, and check on your student account if you see debug information. 

Gemma
In reply to Beatriz Rojo

Re: H5P - embedding code does not work

by Stuart Mealor -

Is the original content on H5P.org by any chance? Rules have changed regarding using that site for ‘real content’ (it’s just for testing purposes).

In reply to Stuart Mealor

Re: H5P - embedding code does not work

by Beatriz Rojo -
Hi Stuart,
thanks for your reply. No, the activities are created directly in the Moodle course using the H5P activity.
In reply to Beatriz Rojo

Re: H5P - embedding code does not work

by Dave Sherwin -
Picture of Particularly helpful Moodlers

Beatriz - you first post mentioned your configurations for the H5P: 

These are the configuration I've been using:

  • I create the activity in a hidden topic named "Hidden resources"
  • The activity availability is set to "Available but not shown on course page".

As indicated in the discussions below, stealth activities are allowed and I deleted the script section of an embedding code and the result is the same.

If those H5P activities are in a Hidden Topic, even if H5P are 'Available but not shown on course page' those activities are truely hidden from the entire course. I thought that Topic level restrictions would supersede the activitiy restrictions???

So what would happen if you put those H5P in the same topic as the book, because the students will not see them, just users in teacher role. That is what we do to make it easier to find those hidden H5P that we embed into books and other content.