Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Adam Morrey -
Number of replies: 21

Basically the title. When I attempt to 'get' any activity to install and use in the editor of the H5P Interactive Content plugin the editor window disappears and nothing happens. 

Average of ratings: -
In reply to Adam Morrey

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Same problem here. Here are the details:

Moodle 4.1.1 (Build: 20230116).
PHP 8.0.
H5P mod_hvp version 1.23.0 dated 2022121200 Additional plugin (the black icon).
H5P settings: Use H5P Hub mod_hvp | hub_is_enabled Yes

Add an activity or resource / Adding a new Interactive Content / Get (a content) / Install / Installing : nothing happens!

Browser Console says: TypeError: e.contentTypes is undefined
value https://MYMOODLESITE/mod/hvp/editor/scripts/h5p-hub-client.js?ver=2022121200:54 (etc.)

1.- On my Moodle site the core H5P mod_h5pactivity works fine, scheduled tasks retrieves h5p contents from the h5p hub OK.

2.- Using H5P mod_hvp Additional plugin (the black icon) I cannot retrieve H5P contents from the H5P hub, but of course I can still upload H5P contents created elswhere, which I use as a workaround, but this is still annoying and unexplainable.

Anyone else having this problem?


Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Adam Morrey -
Thank you for replying and for providing more details. I am quite new to H5P and sadly I don't have access to the work around as I'm unable to generate H5P content if not through moodle, the other options are paid for options no?
In reply to Adam Morrey

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
@Adam,
Are you an admin or a simple teacher on your Moodle site?
If the Moodle contents have been installed by your admin, then you could go to your course's Content Bank and create your H5P activities there, then export them to your computer and re-import them in the h5pactivity plugin.

Or you could install Lumi on your own machine, create H5P activities there, export and re-import to your Moodle site.

But let's hope someone finds a solution to our problem to avoid having to resort to workarounds.
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Adam Morrey -
Thanks again for helping Joseph. I am the admin and it's basically a new install. I'm just a small private class teacher and have made the moodle for myself so I still have alot of learning to do. All I have installed is the mod_hvp plugin. The other H5P plugin was intalled by default.

I will take a look at Lumi, thank you!
In reply to Adam Morrey

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Christophe Coussement -
Picture of Particularly helpful Moodlers
Moodle 4.0.4 and mod_hvp 1.23.0 here, and no problem found in using the plugin.

And Lumi is working too...

Maybe ver 4.1 broke something?
Average of ratings: Useful (1)
In reply to Adam Morrey

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Gemma Lesterhuis -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi Adam,

It could be that the cron task , that picksup contenttypes has not 'run' yet. I noticed this with new installations, since the task frequents is like 1 a month, when you have a new install it does not straight away 'downloads'/ 'make the contenttypes' avaiable.

If you are a site admin (or when not give them these instructions):
  1. Login to site
  2. Go to Server > scheduled task
  3. search for the task "Download available H5P content types from H5P.org (\core\task\h5p_get_content_types_task)
  4. if the column last run says "never' then click on the radar
  5. fill in at minute */1, the rest is *
  6. Save the changes
  7. Wait 1 to 5 minutes (it kind of depends on how frequently your cron is running)
  8. Refresh the page, check if column last run now has a data and time
  9. Click on the 'radar' again 
  10. check thebox "Reset task schedule to default"
  11. Save changes
  12. Go to the COntent bank and check if you now see Contentypes.

If this did not work, check with your technical team/server contantperson if the Cron is correctly configured. Redo the steps. 
I hope this fixed your issue. 
Gemma

Average of ratings: Useful (4)
In reply to Gemma Lesterhuis

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Adam Morrey -
Hi Gemma, thank you so much for your detailed reply.

It looks like you have identified the error. None of the services have ever been run.

Moodle was installed automatically for me by the web hosting service I'm using. I'm going to open a ticket with them as I have Moodle knowledge but very little knowledge about managing a server especially when it comes to managing php files.

I'm just a team of one so hopefully I can get my head around it. Thank you!
In reply to Gemma Lesterhuis

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Adam Morrey -
Thank you, now through the default H5P plugin that came installed with Moodle 4 it's working. I can now add content through the content bank. Thank you thank you thank you!

Installing content still doesn't work for the other H5P plugin however. But as long as I have a way not to create the content I'm happy!
Average of ratings: Useful (1)
In reply to Gemma Lesterhuis

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Paul Raper -
Picture of Particularly helpful Moodlers
That was awesome. I too was wondering why on one site I had H5P content, and on the other there was no possibility to add any content since the add button was inactive.

You tip worked perfectly for me, and I am using Moodle 4.2+ with PHP 8.1.

Why does Moodle wait so long to download this content?
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

When trying to download contents from the H5P hub I'm getting this error in the php_error.log:

[07-Feb-2023 16:42:36 Europe/London] Default exception handler: Exception - chmod(): Argument #1 ($filename) must be of type string, resource given Debug:
Error code: generalexceptionmessage
* line 247 of \mod\hvp\classes\framework.php: TypeError thrown
* line 247 of \mod\hvp\classes\framework.php: call to chmod()
* line 415 of \mod\hvp\editor\h5peditor-ajax.class.php: call to mod_hvp\framework->fetchExternalData()
* line 307 of \mod\hvp\editor\h5peditor-ajax.class.php: call to H5PEditorAjax->callHubEndpoint()
* line 133 of \mod\hvp\editor\h5peditor-ajax.class.php: call to H5PEditorAjax->libraryInstall()
* line 289 of \mod\hvp\ajax.php: call to H5PEditorAjax->action()

Any idea anyone?

In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Gemma Lesterhuis -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi Joseph,
i just uninstalled H5P (plugin - black icon) on 4.1 and reïnstalled again. I cannot make a connection to the hub for some reason. I am running php 8, maybe that is the issue (?).
not sure, no issues in 3.9 with php 7.4 and this version of the plugin.

But it's not the same issue as Adam reported, since that was H5P core related. So I think this best reported to H5P directly since it seems to be unrelated to Moodle itself.
- gemma
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

After racking my brains for 2 days trying to find the reason for this bug, finally discovered that a fix was suggested here https://github.com/h5p/moodle-mod_hvp/pull/472 almost 4 months ago !

Let's hope the H5P team will release a new version of the plugin so that it can finally become usable in Moodle 4.1.

In the meantime, if you have an easy access to your Moodle files, you can apply the fix yourself, it's only a few lines to be changed. I've done it on my Moodle test sites, and can report it's working well. 😉

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by bPREP Staff -

I've spent pretty much half the day trying to figure out how to get the h5P "Adding a new Interactive Content" to work. The Select Content Editor shows up, no matter which content type I choose nothing happens, when I press install.

I see above there is a fix, but I could not find in my files where to make the proper changes. I did open the classes/framework.php file but do not see the 4 items listed on the fix which reference changing "stream" to "filename"?

Maybe I'm misunderstanding something , any help would be greatly appreciated,


In reply to bPREP Staff

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

The file that needs fixing is located at YOURMOODLESITE\mod\hvp\classes\framework.php

and you can view the patch at https://github.com/marsh0lion/moodle-mod_hvp/commit/c64aaae370212bc0bda2a6fdc6d5c1187ce318a5

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by bPREP Staff -
I found out that I cannot install H5P apps directly from the adding interactive content section within a course, but I can download them from moodle,org choose the upload option in adding interactive content and it works perfectly. So this option suit my needs and I am able to use H5P assets in my courses. Thanks.
In reply to bPREP Staff

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Didn't you try applying the fix I suggested?
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by bPREP Staff -
Yes I did, and actually left the file with the changes on it. I get the same result when trying to install H5P content directly. It could be a server restriction.
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Mosaab Alsiddig -
I have try the fix and nothing changed. it still cannot install activities
In reply to bPREP Staff

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Sudhir Singhal -
Can you share the link for downloading H5P content type files from moodle.org?
It shows the plugin only but cannot find individual content-type files to upload directly.
In reply to Joseph Rézeau

Re: Can't 'get' activities in H5P Interactive Content Plugin [Moodle 4.0]

by Sudhir Singhal -
Thanks Joseph!
I made the changes in framework.php and it really works well and solves my problem.
I noticed that people are facing this problem since January 2023, but still it is not updated in the plugin.
Hope soon we will receive the new update.
Thanks once again for the solution.