首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装“H5P.Scorm.h5p”库:“上传的文件不是有效的h5p包”

无法安装“H5P.Scorm.h5p”库:“上传的文件不是有效的h5p包”
EN

Drupal用户
提问于 2018-06-14 01:26:43
回答 1查看 210关注 0票数 0

多亏了杰克拉比萨纳在另一个问题上的帮助我似乎是将H5P相关库安装到Drupal7.59中的1/2方式。我在MAMP4.5(PHP7.1.12)和MamP3.5.2(PHP5.6.10)下的macOS High上尝试这样做。

但是就像我说的,我已经走了1/2的路,没有完全到达那里。我能够安装H5PEditor.ScormFile (1.0.8)库,但不能安装H5P.Scorm (1.1.16)

有关图书馆如下:

为了帮助这个过程,我现在设计了一个Bash脚本过程,以获得从源h5p repos构建的GitHub包。以下是我所做的,…

The H5PEditor.ScormFile (1.0.8) Bash dance:

代码语言:javascript
复制
cd ~/Desktop/

git clone https://github.com/pavloshevchuk/h5p-editor-scorm 

cd ~/Desktop/h5p-editor-scorm

find . -type f \( -name '.DS_Store' -o -name '.gitignore' -o -name 'LICENSE' -o -name 'README.md' \) -exec rm {} \;
find . -type d -name '.git' -exec rm -rf {} \;

mkdir H5PEditor.ScormFile && mv {scripts,styles,*.json} H5PEditor.ScormFile

echo '{
  "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",
}' > h5p.json

zip -r ../H5PEditor.ScormFile.h5p *

The H5P.Scorm (1.1.16) Bash dance:

代码语言:javascript
复制
cd ~/Desktop/

git clone https://github.com/pavloshevchuk/h5p-scorm

cd ~/Desktop/h5p-scorm

find . -type f \( -name '.DS_Store' -o -name '.gitignore' -o -name 'LICENSE' -o -name 'README.md' \) -exec rm {} \;
find . -type d -name '.git' -exec rm -rf {} \;

mkdir H5P.Scorm && mv {css,js,*.json} H5P.Scorm
mkdir content && mv icon.svg content

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

zip -r ../H5P.Scorm.h5p *

完成了这两件事之后,我现在准备好了两个H5P文件:H5PEditor.ScormFile.h5pH5PEditor.ScormFile.h5p

但是,在按预期安装H5PEditor.ScormFile.h5p的同时,H5PEditor.ScormFile.h5p也不能这样做。我收到以下Drupal系统信息消息:

出于安全考虑,您的上传已重命名为H5P.Scorm_.h5p。

接下来是这个“好消息”:

上载的文件不是有效的h5p包。

截图附在下面。任何洞察力都是值得赞赏的。

EN

回答 1

Drupal用户

回答已采纳

发布于 2018-06-14 16:39:45

短答案

需要为H5P显式安装字体库(4.5.4),以便可以安装Scorm (1.1.16)。详细情况是如何在回答接近尾声的时候完成的。

长答案

幸运的是,我自己解决了这个问题。从一个新鲜的,干净的,100%的Drupal 7.59的新安装开始,我再次继续这个过程。安装H5PEditor.ScormFile (1.0.8)很好--就像以前在更成熟的Drupal7.59安装上一样--但在H5P.Scorm (1.1.16)…中遇到了同样的问题但是,在这个干净的安装中,我确实通过错误报告中的更多细节获得了一个主要线索;下面的屏幕截图,但文本如下:

“缺少必需的库FontAwesome 4.5”

我认为这个错误意味着没有安装字体的Drupal模块和相关库,这就是为什么“上传的文件不是有效的h5p包”的原因。

因此,我继续这样做--并安装了FontAwese4.7库--截图如下:

再次尝试安装H5P.Scorm (1.1.16)…同样的,同样的信息:

“缺少必需库FontAwesome 4.5”消息。

因此,我认为这一切意味着H5P需要自己安装字库,包括字体、谷歌和找到了这个与H5P相关的字体

太棒了!所以现在学习我以前在另一个答案中学到的东西,我想出了如何创建我自己的H5P.FontAwesome.h5p库,它非常好用!下面的屏幕截图显示这个过程确实有效,并且在安装了特定于H5P.Scorm (1.1.16)的字体库之后,我就可以安装H5P了:

为了让每个人的生活变得更容易--尤其是我的生活--我创建了一个相当简单的Bash脚本,允许我在我的H5PEditor.ScormFile.h5p机器上自动创建H5P.FontAwesome.h5pD19H5P.Scorm.h5p库;源代码见下面。只需将其保存为一个名为build_h5p_scorm_libs.sh之类的Bash文件,并通过chmod u+x build_h5p_scorm_libs.sh为自己提供执行权限,就可以了。

图书馆安装顺序如下:

  • H5PEditor.ScormFile.h5p
  • H5P.FontAwesome.h5p
  • H5P.Scorm.h5p

真心希望这对未来的人有所帮助!

代码语言:javascript
复制
#/bin/bash

################################################################################
# Build the H5PEditor.ScormFile H5P file.
################################################################################

# Go to the Desktop.
cd ~/Desktop/

# Clone the repo.
git clone https://github.com/pavloshevchuk/h5p-editor-scorm

# Go into that cloned repo.
cd ~/Desktop/h5p-editor-scorm

# Clean up cruft that is not needed for the H5P file.
find . -type f \( -name '.DS_Store' -o -name '.gitignore' -o -name 'LICENSE' -o -name 'README.md' \) -exec rm {} \;
find . -type d -name '.git' -exec rm -rf {} \;

# Create the library directory and copy files into it.
mkdir H5PEditor.ScormFile && mv {scripts,styles,*.json} H5PEditor.ScormFile

# Create the 'h5p.json' file.
echo '{
  "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",
}' > h5p.json

# Now Zip that all up into a compressed `.h5p` archive like this.
zip -rq ../H5PEditor.ScormFile.h5p *

################################################################################
# Build the H5P.FontAwesome H5P file.
################################################################################

# Go to the Desktop.
cd ~/Desktop/

# Clone the repo.
git clone https://github.com/h5p/font-awesome

# Go into that cloned repo.
cd ~/Desktop/font-awesome

# Clean up cruft that is not needed for the H5P file.
find . -type f \( -name '.DS_Store' -o -name '.gitignore' -o -name 'LICENSE' -o -name 'README.md' \) -exec rm {} \;
find . -type d -name '.git' -exec rm -rf {} \;

# Create the library directory and copy files into it.
mkdir FontAwesome && mv {*.css,*.otf,*.eot,*.svg,*.ttf,*.woff*,*.json} FontAwesome

# Create the 'h5p.json' file.
echo '{
  "title": "FontAwesome",
  "language": "en",
  "license": "cc-by-sa",
  "preloadedDependencies": [
    {
      "machineName": "FontAwesome",
      "majorVersion": 4,
      "minorVersion": 5,
      "patchVersion": 4
    }
  ],
  "mainLibrary": "FontAwesome"
}' > h5p.json

# Now Zip that all up into a compressed `.h5p` archive like this.
zip -rq ../H5P.FontAwesome.h5p *

################################################################################
# Build the H5P.Scorm H5P file.
################################################################################

# Go to the Desktop.
cd ~/Desktop/

# Clone the repo.
git clone https://github.com/pavloshevchuk/h5p-scorm

# Go into that cloned repo.
cd ~/Desktop/h5p-scorm

# Clean up cruft that is not needed for the H5P file.
find . -type f \( -name '.DS_Store' -o -name '.gitignore' -o -name 'LICENSE' -o -name 'README.md' \) -exec rm {} \;
find . -type d -name '.git' -exec rm -rf {} \;

# Create the library directory and copy files into it.
mkdir H5P.Scorm && mv {css,js,*.json} H5P.Scorm

# Create the content directory and copy files into it.
mkdir content && mv icon.svg content

echo '{
  "title": "SCORM/xAPI",
  "language": "en",
  "author": "Pavlo Shevchuk",
  "license": "cc-by-sa",
  "preloadedDependencies": [
    {
      "machineName": "H5P.Scorm",
      "majorVersion": 1,
      "minorVersion": 1,
      "patchVersion": 16
    }
  ],
  "mainLibrary": "H5P.Scorm",
  "embedTypes": [
    "div"
  ]
}' > h5p.json

# Now Zip that all up into a compressed `.h5p` archive like this.
zip -rq ../H5P.Scorm.h5p *
票数 1
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/263222

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档