dev mode/dev dir setup

Hi,

Thanks for opening up this exciting project!

I am trying to set up a development environment for working on some modifications to existing libraries and to try porting some of our existing interactives to H5P.

I followed these directions, and have devlopment mode enabled:

https://h5p.org/development-environment

I found these two tutorials a bit confusing - 

https://h5p.org/tutorial-greeting-card

https://h5p.org/hello-world-h5p-package

What is the directory structure I should have inside sites/default/files/h5p/development ? 

I tried

 greeting
├── content
│   ├── content.json│   └── earth.jpg├── H5P.GreetingCard│   ├── greetingcard.js│   ├── library.json│   └── semantics.json└── h5p.json

 

and many variations, but it doesn't seem to work.

I'll note that when I was missing the 'content' directory, it seemed to break my drupal site without any error messages. 

I'm unclear if I need to zip the dev package up up, or if I need to remove the other libraries, or what? 

I am also unsure of what this warning in the settings file means:

"Check to enable development of libraries in the sites/default/files/h5p/development folder. ONLY ENABLE THIS OPTION IF YOU KNOW WHAT YOU ARE DOING! YOUR SITES H5P DATA WILL BE RUINED BY ENABLING THIS OPTION"

What data might be ruined? What is the recommended way to develop new content types/libraries?

Thanks,

/jb

falcon's picture

I tried to make the development environment page more clear by adding "In your file folder go to sites/default/files/h5p/development and place the libraries you want to develop in this folder. So for instance if you want to work on interactive video you'll have interactive video's library.json in sites/default/files/h5p/development/h5p-interactive-video/library.json."

You should set up a drupal site from scratch for development and not keep any H5P content there that you are afraid of loosing. The development folder might mess up existing H5P data when it is enabled.

H5P will look in the development folder first for H5P libraries, but will after that look in the database and normal library folder to find what it needs.

 

falcon's picture

And thank you for your feedback. We would love to see some of your interactions shared as H5Ps here on H5P.org :)

Hi,

Thanks for the rapid reply. 

I am still a bit confused. 

This tutorial (https://h5p.org/hello-world-h5p-package) on creating a manual package specifies creating an h5p.json file and a content subdirectory:

greeting/h5p.json

greeting/content/

The library is nested in a subdectory:

greeting/H5P.GreetingCard

The system is now seeing the content type, but reporting "Error, could not load the content type form."

I am finding the error message to be rather opaque, and am unsure how to debug problems like these.

Are there any plans to introduce test harnesses into this framework to allow for greater confidence in the code and sanity checks along the way?

thanks

falcon's picture

Hi,

Are you creating this in the Drupal development folder sites/default/files/h5p/development? If so you should put the library in sites/default/files/h5p/development/h5p-greeting-card - and skip the content folder and h5p.json

If not make sure all the following files and folders are in the root of the zip:

  • h5p.json
  • content
  • H5P.GreetingCard

i.e. make the contents of the greeting folder the root of the zip, the greeting folder itself shouldn't be part of the zip.

We're planning to add automated testing. The reason we don't have it already is that we needed to prove that H5P can solve important problems in order to secure funding. Automated testing from the start would have delayed a version of H5P that would be used by organizations in our target group.