About modification of h5p file

Hi all,

We have used branching scenario in order to make a quizz with this.

This quizz become hugh and we need to have a copy of this quizz but without some branch.

Actually we see it is not possible to move branch from one to another.

If we delete branch, we deleted all child's element.

I download h5p file and unzip content.

I see in folder content a json file content.json which contains all branchs.

I understand how it is created and change manually attribute "nextContentId" in order to go to correct id.

My problem is to upload this file (I use h5p with moodle).

I zip this file, change extension.

When I upload file, I have this kind of error.

Validating h5p package failed.

File "blob-1.0/" not allowed. Only files with the following extensions are allowed: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt js css.Get help

File "blob-1.0/scripts/" not allowed. Only files with the following extensions are allowed: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt js css.Get help

File "content/" not allowed. Only files with the following extensions are allowed: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt.Get help

File "content/images/" not allowed. Only files with the following extensions are allowed: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt.Get help

File "downloadify-1.0/" not allowed. Only files with the following extensions are allowed: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt js css.Get help

 

When I unzip h5p, it automatically create folders.

How can I modify h5p manually and upload it ?

Can you advise?

Thanks in advance

Laurent

BV52's picture

Hi Laurent,

Did you zip the folder or the files? Zipping the folder will not work instead you need to zip the files.

-BV52

When I unzip h5p file, it create a lot of subfolders like folder content where content.json is.

Is it normal to have theses subfolders ?

I zip all of these subfolders not only files.

What is the best way to unzip and zip h5p files ?

Regards

studyaid's picture

I have run into the same issue and it depends on what OS and zip program you use to compress the files.

If you search the forums you might find my other postings on how to fix depending on what program or system you are using

 

 

Hi studyaid,

I run on Windows and use 7zip.

I search on forums with keyword zip and found your answer https://h5p.org/node/275080

I follow your instructions on Linux (I previously install zip package)

zip -r -D -X css_test.h5p *

-D   do not add directory entries

-X   eXclude eXtra file attributes

Now I can upload file.

I think I will continue to use Linux to zip file.

Thank you for your solution

studyaid's picture

The instructions are in the post below for 7-zip.

https://h5p.org/comment/29623#comment-29623

"zip -r -D -X css_test.h5p *" is indeed the right approach on linux. Thanks for sharing!

serettig's picture

There is a similar discussion here: https://h5p.org/node/617131

is not possible to do that on Windows?