Adding more to an already existing content type

Hey everyone,

I'm trying to make a fork of an already existing H5P activity.

I want it to be a lot like the Documentation tool and Interactive book combined. I'd like to include things like questions, pictures, drag and drop activities, and fill in the blank exercises in the Documentation tool. This way, I can make a page that students can then turn in with more information than just text.

I've been trying to figure out how to do this in the development environment, but I'm having a hard time getting started. I know some Javascript, but I'm having trouble understanding how H5P is set up.

I've looked at the Documentation tool on Github, and I noticed that the schemantics.json file lists different libraries you can use. If I could just add more libraries to the Documentation tool, like the ones in the Interactive book, that would be perfect.

Thank you so much,
DS

Content types: 
otacke's picture

Hi!

Have you had a look at the the developer guide as well? Or at some basic tutorial videos that one can find on YouTube?

Best,
Oliver

Hi Oliver,

In short; Both.


I was looking on your Github repo of the dictation tool as per your video, and you seem to have everything there (package.json etc) for me to package it up, and use the CLI tool to throw the .h5p file into my LMS;
However, the offical h5p Documentation Tool repo seems to have files missing that allows me to do that?

I watched your video on the semantics.json file which made me think I could do this without really writing and javascript, and just adding it as an option to the Documentation Tool (along side the text, export page, goals etc) by just editing that and including the libraries? You mentioned it somewhere in the semantics.json video at 6:30.

Am I missing something here? Is the multiple choice you showed off in the semantics.json video different to the dictation tool in the video you linked? 

Thank you so much for your help.

otacke's picture

In theory, it's as easy as adding more H5P libraries as subcontents.

In practice, there will be things to check, such as parameter sanitization and resizing as I mentioned in the respective video.

And DocumentationTool is a special case. You'll notice that in its' `semantics.json` it references four different libraries as subcontents. Those for are H5P libraries, but not `runnable` (see explanation in documentation for `library.json`), so no content type. They are merely helping libraries that DocumentationTool expects to follow a particular structure. The original author called these libraries a "page". So, you cannot simply add a content type library to Documentation Tool, but would either need to amend its code or to have a deeper look. The "Standard Page" handles regular content type libraries as subcontents, so you could add other content type libraries here.

Thanks for the help!

Once I've added the libraries and their versions, how would I add the new standard page to Moodle? Just by zipping it, and changing the file extension to .h5p, uploading it to the moodle.instance/h5p/libraries.php with a new version number? Is there anything else I need to do apart from changing the `semantics.json` file contents? I get an error when I do this. "Invalid H5P content type". You didn't go over the install of a library in your videos that I saw.

Nb: I do not have access to the files of the moodle instance as it's managed by a third party.

otacke's picture

You'd use the H5P CLI tool to build a library package as described in the documentation or my tutorial videos. But beware, you're now entering dangerous terrain. If you do what you intend to do, you must create a fork of Documentation Tool or you may mess up that moodle instance or even other people instances when they reuse content and receive your patched version.

otacke's picture

What are you trying to achieve anyway? Anything cool that the H5P community might be able to play with soon?

I am interested in expanding the range of assessment options available within the documentation tool. Specifically, in addition to the existing export feature, I believe it is important to incorporate additional functionalities to accommodate the diverse learning approaches we employ, particularly in the context of blended learning.

My objective is to introduce features such as true/false questions and, notably, a checklist function that allows students to mark items and append relevant notes. These additions would enable the exported documents to display an offline checklist they can use in class as walking around with a laptop in certain professions is not practical. It could also be used afterwards as a digital record for us to keep track of / mark for submission. 

otacke's picture

You should then pre-qualify this with the H5P core team first if you want this to become part of the official code. Otherwise, you may create code and a pull-request in vain only to be informed later that this is not something that they want. In the latter case, you should create a clean fork (with a different machine name) and not just amend the original code.