Uploading Hello World Package (.h5p file) fails =>
This was already discussed here https://h5p.org/node/617131 ... but i am not able to solve the issue for me.
I am running a Moodle 3.9 stable release with the H5P Plugin installed.
I created the hello world package following the official tutorial.
Uploading the .h5p file in the moodle content bank:
I figured out that the issue is related to how directories are archived in the zip file. But I did not found a way to solve this. I tried zipping the package under Ubuntu and windows 10 using different tools. With no success.
For example Arithmetic-Quiz Zipfile vs my Hello World Zipfile (i used 7-Zip)
Please provide information how to create a valid h5p package file under windows 10.
Mon, 06/29/2020 - 23:32
Mon, 06/29/2020 - 23:33
Arithmetic Quiz Zipfile
Arithmetic Quiz Zipfile Structure vs my Hello world Zipfile Structure
Tue, 06/30/2020 - 14:09
Hi awertner!The proper and
The proper and documented way to create H5P libraries is by using git repositories and H5P CLI, not manually zipping everything. I don't remember exactly, but if you really want to do it the hard way, then there's a particular flag that needs to be set when zipping. Might have been -D and/or -X to discourage directory entries and to exclude extra file attributes.
Wed, 07/01/2020 - 10:45
Hi otacke,I prefer the proper
I prefer the proper way and will give it a try.
Wed, 07/01/2020 - 12:02
Hi Alfred!Once you have it
Once you have it running you'll like it, I think :-D The tool can automatically strip files that shouldn't be in the archive, pack libraries recursively, help you with translations, etc. The only quirk is that it expects to be working on git repositories, so if your folder with the H5P content isn't one, you'll have to add a dummy file .git/config to trick it.
Thu, 07/02/2020 - 13:16
Now i am working on a git
Now i am working on a git repository and using the H5P command line interface.
And i can create the package file with the h5p pack command.
Very nice, worked out fine.
Looking in the packed files folder structure, the library folder as root folder is included.
...and so on
Importing the .h5p file in moodle fails because it expects the folder structure on the level "inside" the library folder.
I could not figure out how to achieve this with the h5p pack command.
I am working under windows 10, Ubuntu Subsystem.
Thu, 07/02/2020 - 19:24
Hi Alfred!There are
There are (unfortunately) two types of H5P files, and that might be the origin of the confusion.
Content files are the packages that can be downloaded by using the reuse button below H5P content or by fetching them from the host system's export folder. They contain
This allows you to share the files and be (quite) sure that they can be used on another platform even if that is missing some of the libraries. H5P will install those that are missing from the package if that's not prohibited by the admin.
Those content files need to be uploaded using the H5P Hub.
to create a library package named output.h5p in your home directory. That package would contain a folder named after the machine name that's defined in your library.json followed by the version number, so e.g. H5P.HelloWorld-1.0. That folder then would contain the files required for the library. The h5p.json file and the content folder should ot be inside your development folder that you pack with H5P cli; they are only required by content.
Those library packages cannot be uploaded using the H5P Hub, but they must be uploaded on the H5P library page.
Hope that helps.