Question about automation with scripts
Submitted by Vulnin on Tue, 07/09/2019 - 12:35
Forums:
Hi there,
I like to ask you about the following idea. I got multiple choice questions in an arbitrary format and I like to code a script which uses H5P to implement these in a video. I got the time stamps for the places of the questions in a separate way. So my questions are: Is it ok for you to have a script which uses H5P and do you think this is even possible?
Thanks a lot for your answers,
regards
Vulnin
otacke
Wed, 07/10/2019 - 09:26
Permalink
Hi Vulnin!You can unzip an
Hi Vulnin!
You can unzip an H5P file and inside will find the file content/content.json. It's a a plain text file in JSON format holding all the parameters for the content type, and the structure is defined by the semantics.json file of each content type. You can learn more about it in the H5P specification.
So in short: Yes, it's possible build H5P content programmatically and it's not that complicated. Sebastian Rettig did exactly that for Flash Cards. I am not sure what the real question behind "Is it ok for you to have a script which uses H5P" is, but of course you're welcome to write your own scripts if you want to.
Cheers,
Oliver
leturf123
Thu, 09/12/2019 - 16:49
Permalink
In Drupal, I built a wizard
In Drupal, I built a wizard for teachers that automatically creates large pieces of h5p content using various content types.
It's laborious but not that complicated to build out the JSON array that H5P uses. Maybe there was a better way but you can basically just reverse-engineer what a finished H5P's JSON array looks like.
Try saving a video with some time-stamps, and look at the JSON. Create a form that creates that JSON and saves a new node, or whatever it's called in Wordpress etc.
Not much more I can say. It's just a manual approach that ended working really well for me. Teachers can create content with 60+ questions in around two minutes.