Pleaase share more detailed examples for porgramatically creaating H5P files.

Forums: 

Could someone share example codes to show how to porgramatically creaate H5P files with https://github.com/h5p/h5p-cli or https://github.com/h5p/h5p-editor-php-library?

otacke's picture

As mentioned on github two weeks ago: The H5P CLI is not meant to programatically creating H5P files, neither is the h5p-php-library. The former is a local development environment, the latter is the core library of H5P (you could call it a runtime engine maybe).

And also as mention, here on the forum: I'd begin by understanding what the semantics.json file is and how it works. See https://h5p.org/documentation/developers/h5p-specification for starters.

Then you will know what the content.json file is that is also described in the specification - and it's the same structure that you will find in databases of H5P integrations.

Once you get all that, you merely need to build yourself a set of functions that take input from sources and mold them into the content.json structure. Et voilà, you programmatically created H5P content.