Who is this for?
This procedure will be useful if you have a number of H5P contents already created with the original/default/standard/official version of H5P and want to convert them to a papi Jo version without having to re-create them from scratch.
How does it work?
Any H5P content that you create on your site using H5P is saved somewhere on your site (or on your computer if you are using Lumi). When you create an H5P content if you provide the option for the end-user to Download it, then it can be downloaded to your computer by clicking the Re-Use button just under the H5P content. An H5P file thus saved is in fact a zipped archive which contains 3 different "elements":
- a content folder, which contains the text elements of your H5P content, plus optionally images and audio folders;
- all the H5P libraries which are needed by your content, including the main library itself, and also a number of dependent libraries;
- a h5p.json file which contains the names of your content's main and dependent libraries
All you need to do to convert a default H5P content to its papi Jo version is to replace that h5p.json file with the equivalent papi Jo h5p.json file.
- the original H5P file which you created with one of those libraries: Dialog Cards, Drag and Drop, Drag the Words, Mark the Words, Advanced Fill in the Blanks
- a file archiver utility to be downloaded and installed on your machine; I recommend PeaZip
- the latest available version of the zipped collection of papi Jo h5p.json files which you need to download from https://www.rezeau.org/public/drupal-h5p-test-site/papijo-h5p-json-files.zip and save to a place that you'll remember on your computer
IMPORTANT- Never unzip and re-zip an h5p file, as this process may corrupt the file and render it useless. You can only use your archiver utility to open it, edit it and exit the archiver utility to save the changes.
- Before you start, you must have installed the necessary papi Jo libraries on the site where you will be using the converted h5p content, of course!
- For this example we'll see how to convert the Drag the Words sample content downloaded from the H5P site at https://h5p.org/drag-the-words. We have saved that file drag-the-words-1399.h5p to our computer.
- In order for the PeaZip utility to recognize an h5p file as an archive, it must be renamed with a *.zip extension so we slightly change the name and change the extension of the original drag-the-words-1399.h5p file to drag-the-words-berries.zip. When you do this Windows may issue a warning about how changing a file's extension may cause probems. Do not take account of this warning. For your own use, in the instructions below, replace drag-the-words-berries.h5p and drag-the-words-berries.zip with the actual name of the h5p file that you want to convert. But remember to rename your own h5p file with the *.zip extension.
- On your windows desktop or explorer, find the papijo-h5p-json-files.zip that you have previously download and right-click and Open as Archive with PeaZip. This opens the archive and lets you see its contents, consisting of 5 folders, named after the current versions of the papi Jo libraries.
- Because we are converting an H5P Drag the Words content, we need to use the papi Jo version of its h5p.json settings file, so double-click on the Drag the Words papi Jo (1.0.12) folder to open it and display its contained h5p.json settings file.
- In Windows explorer, right-click on drag-the-words-berries.zip and select Open with PeaZip.
You see this:
- Now on your desktop arrange side by side the 2 opened PeaZip windows, like this:
- In the left windows (drag-the-words-berries.zip): remove/delete all the folders contained in the archive, except for the "content" folder.
- Now click on the Add button at the top left of the PeaZip toolbar.
You see this:
- Now in the right window (papijo-h5p-json-files.zip) in the Drag the Words papi Jo (1.0.12) folder: Select and drag and drop file h5p.json to the left windows where it says "Drag here files etc.". Click wait a little and click OK and ... you can see that a h5p.json has been added to the drag-the-words-berries.zip archive. Now in the left PeaZip window menu click File / Quit.
- Now locate on your machine the file named drag-the-words-berries.zip and rename it to e.g. drag-the-words-berries-papijo.h5p. That's it! Now you can upload file drag-the-words-berries-papijo.h5p to your site and check that the papi Jo features are available to you converted content.
- One last thing, the conversion process will change the "Title" field of your original content with a reference to papi Jo. You will need to Edit your content (on your site) to restore the original title.