2

The subject says it all. I am attempting to install H5P SCORM libraries in an install of Drupal 7.59 and running into a roadblock: None of what I am reading—or understanding—is clear about how to install the libraries. I am attempting this on macOS High Sierra under MAMP 4.5 (PHP 7.1.12) and MAMP 3.5.2 (PHP 5.6.10). Apache permissions are fine as far as I can see, FWIW and other temp files and uploads work fine on this setup.

I have installed the following two modules in Drupal:

And on the module’s install page I have activated all three modules connected to them:

  • H5P (7.x-1.35)
  • H5P Editor (7.x-1.35)
  • H5P SCORM (7.x-2.4)

But when I go to install the libraries… I just can’t seem to get them to upload without some error happening such as a problem expanding the archive into the temp/ directory and such. The weird thing is temp direcroures are clearly created, but there is no content in them.

I have even followed the “Better Install Instructions” that appear here as a contributed “issue” but with no luck.

The libraries in question are as follows:

Do the decompressed files need to have a directory name such as H5PEditor.ScormFile.h5p or H5P.Scorm.h5p? Because if I simply rename the files, the created directory is still h5p-editor-scorm-master and h5p-scorm-master.

The tangential question is… Is there simply a way I can just physically place files in the correct directory structure user libraries/? Or must it be installed via the administration interface? It seems to me if I could just drop those files in, Drupal—and the H5P modules—should be able to see them, right?

2

See this page about how to manually construct H5P packages and follow the same process for each repo.

You need to download the repo Zip file. Decompress into a temp directory. Delete the LICENSE, README.md, and .gitignore files

Create a new folder to hold the rest of the files like library.json, CSS, JS For the H5P editor, name it H5PEditor.ScormFile. For the h5p-scorm-master, use H5P.Scorm:

Outside of the new folder, create an h5p.json file.

For the H5PEditor.ScormFile, use this:

{
  "title": "H5PEditor.ScormFile",
  "language": "en",
  "author": "Pavlo Shevchuk",
  "license": "cc-by-sa",
  "preloadedDependencies": [
    { "machineName": "H5PEditor.ScormFile", "majorVersion": 1, "minorVersion": 0,"patchVersion": 8, }
  ],
  "mainLibrary": "H5PEditor.ScormFile",
}

for the H5P.Scorm, use:

{
  "title": "SCORM/xAPI",
  "language": "en",
  "license": "cc-by-sa",
  "preloadedDependencies": [
    { "machineName": "H5P.Scorm", "majorVersion": 1, "minorVersion": 1, "patchVersion": 16, }
  ],
  "mainLibrary": "H5P.Scorm",
  "embedTypes": ["div"]
}

Now Zip up the right h5p.json folder and the H5PEditor.Scormfile or and the other with H5P.Scorm directory. Zip compress each, naming the editor file H5PEditor.ScormFile.h5p and the second library H5P.Scorm.h5p.

Creating H5PEditor.ScormFile.h5p.

So create Zip file renamed to H5PEditor.ScormFile.h5p. Inside of that you have a folder named H5PEditor.ScormFile with contents of the Git repo, https://github.com/pavloshevchuk/h5p-editor-scorm, specified files removed. You also create a h5p.json file with the code provided. Place it in the Zip file but outside the H5PEditor.ScormFile directory.

H5PEditor.ScormFile.h5p
├── H5PEditor.ScormFile
│   ├── library.json
│   ├── scripts
│   │   ├── scormFile.js
│   │   └── scormFileUploader.js
│   └── styles
│       └── scormFile.css
├── H5PEditor.ScormFile.h5p

Creating H5P.Scorm.h5p.

Create a second Zip file renamed to H5P.Scorm.h5p. Inside of that you have a folder named H5P.Scorm with contents of the Git repo: https://github.com/pavloshevchuk/h5p-scorm, specified files deleted. Place the icon.svg file in a directory called content, inside the Zip file. You also create a h5p.json file with the code provided. Place it in the Zip file but outside the H5P.Scorm directory. The Zip file contains this structure:

H5P.Scorm.h5p
├── content
│   └── icon.svg
├── h5p.json
├── H5P.Scorm
│   ├── css
│   │   └── scorm.css
│   ├── js
│   │   ├── api
│   │   │   ├── api_1_2.js
│   │   │   ├── api_2004.js
│   │   │   ├── datamodel.js
│   │   │   ├── debug.js
│   │   │   └── flash_detect.js
│   │   └── scorm.js
│   ├── library.json
│   └── semantics.json

You should now have two H5P files and you will now be able to update them at the H5P admin libraries page:

admin/content/h5p

Here's a repo containing the files I made following these instructions: https://github.com/jackrabbithanna/h5p-scorm-libraries

  • I know I tried a couple of times before I got it right and didn't get that error. You could look in the site's public files directory and see if a file H5P.Scorm.h5p already exists there, and the delete it, then try the upload again – jackrabbithanna Jun 13 '18 at 16:22
  • If there's an entry in the file_managed database table with a value for the uri column that contains the file name for the .h5p file, try deleting that row in the database. – jackrabbithanna Jun 13 '18 at 22:42
  • 1
    I provided the answer for the original question, now you ask a new one. Should be a separate post – jackrabbithanna Jun 14 '18 at 0:01
  • 2
    @JakeGould I cleaned up a bunch of comments. Continuing to add to your question after answers have come isn't a great for for any SE site. meta.stackexchange.com/questions/43478/… is a starting point for the reasoning behind this. – mpdonadio Jun 14 '18 at 0:10
  • 1
    Fantastic! I must have already had the font awesome library from other H5P content types I had installed. Would you like to fork my github repo of the h5p files and make a PR, adding your font awesome library, so that people in the future can just get down to business? – jackrabbithanna Jun 14 '18 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.