haggag/h5p-report
Composer 安装命令:
composer require haggag/h5p-report
包简介
H5P Report functionality in PHP
关键字:
README 文档
README
A generic library for rendering H5P reports for content types based on their xAPI statements.
Usage
- To start with we need xAPI data from the content we will render, covered in Content type requirements.
- We can then call
H5PReport->generateReportwith the content statement and an optional parent ID. Parent ID is provided if the content type is the parent of other content. This can be determined from its children. - Returned is HTML for the complete report.
Generate report
Generate report expect a special format of the xAPI data, an object with the several properties. Following is a simple example:
(object) array( 'interaction_type' => 'choice', 'description' => 'Do you like cake ?', 'correct_responses_pattern' => '[0]', 'response': '2', 'extras': '{"choices":[{"id":0,"description":{"en-US":"Of course, who doesn't ?"}},{"id":1,"description":{"en-US":"No"}},{"id":2,"description":{"en-US":"What is a cake ?"}}},' )
Note that correct_responses_pattern and extras should be json
encoded.
Content type requirements
The plugin requires content types to implement the getXAPIData contract
in order to get the proper reports with a statement object and an optional
children array:
getXAPIData = function () { return { statement: {}, children: [] } }
Statement
The statement object is a standard xAPI statement, which should adhere to the xAPI specification. You can see an example for how this looks for True False question in Appendix A.
Children
The children array is a collection of statements for the children of the content. An Interactive Video with "Summary" and "Mark The Words" content inside of it would have its own statement and two children items with their own statements. Children may also have children, so you can follow the chain all the way down to the lowest level. A complete example of Single Choice Set can be found in Appendix B.
Appendix A
An example of an xAPI statement from True False question.
{
"actor":{
"name":"user",
"mbox":"mailto:user@mail.com",
"objectType":"Agent"
},
"verb":{
"id":"http://adlnet.gov/expapi/verbs/answered",
"display":{
"en-US":"answered"
}
},
"object":{
"id":"https://h5p.org/true-false",
"objectType":"Activity",
"definition":{
"extensions":{
"http://h5p.org/x-api/h5p-local-content-id":34806
},
"name":{
"en-US":"True/False Question"
},
"interactionType":"true-false",
"type":"http://adlnet.gov/expapi/activities/cmi.interaction",
"description":{
"en-US":"Oslo is the capital of Norway.\n"
},
"correctResponsesPattern":[
"True"
]
}
},
"context":{
"contextActivities":{
"category":[
{
"id":"http://h5p.org/libraries/H5P.TrueFalse-1.0",
"objectType":"Activity"
}
]
}
},
"result":{
"score":{
"min":0,
"max":1,
"raw":0,
"scaled":0
},
"completion":true,
"success":false,
"duration":"PT4.92S",
"response":""
}
}
Appendix B
An example of a complete getXAPIData call to Single Choice Set.
{
"statement":{
"actor":{
"name":"user",
"mbox":"mailto:user@mail.com",
"objectType":"Agent"
},
"verb":{
"id":"http://adlnet.gov/expapi/verbs/answered",
"display":{
"en-US":"answered"
}
},
"object":{
"id":"https://h5p.org/single-choice-set",
"objectType":"Activity",
"definition":{
"interactionType":"compound",
"type":"http://adlnet.gov/expapi/activities/cmi.interaction",
"extensions":{
"http://h5p.org/x-api/h5p-local-content-id":1515
}
}
},
"result":{
"duration":"PT0S",
"score":{
"raw":0,
"min":0,
"max":3,
"scaled":0
}
}
},
"children":[
{
"statement":{
"actor":{
"name":"user",
"mbox":"mailto:user@mail.com",
"objectType":"Agent"
},
"verb":{
"id":"http://adlnet.gov/expapi/verbs/answered",
"display":{
"en-US":"answered"
}
},
"context":{
"contextActivities":{
"parent":[
{
"id":"https://h5p.org/single-choice-set",
"objectType":"Activity"
}
]
}
},
"object":{
"id":"https://h5p.org/single-choice-set?subContentId=51445ea9-9c98-437a-8981-72d46d6e86c4",
"objectType":"Activity",
"definition":{
"description":{
"en-US":"Goji berries are also known as ..."
},
"interactionType":"choice",
"correctResponsesPattern":[
"0"
],
"type":"http://adlnet.gov/expapi/activities/cmi.interaction",
"choices":[
{
"id":"0",
"description":{
"en-US":"Wolfberries"
}
},
{
"id":"1",
"description":{
"en-US":"Catberries"
}
},
{
"id":"2",
"description":{
"en-US":"Bearberries"
}
}
],
"extensions":{
"http://h5p.org/x-api/h5p-local-content-id":1515,
"http://h5p.org/x-api/h5p-subContentId":"51445ea9-9c98-437a-8981-72d46d6e86c4"
}
}
},
"result":{
"response":"",
"duration":"PT0S",
"score":{
"raw":0,
"min":0,
"max":1,
"scaled":0
}
}
}
},
{
"statement":{
"actor":{
"name":"user",
"mbox":"mailto:user@mail.com",
"objectType":"Agent"
},
"verb":{
"id":"http://adlnet.gov/expapi/verbs/answered",
"display":{
"en-US":"answered"
}
},
"context":{
"contextActivities":{
"parent":[
{
"id":"https://h5p.org/single-choice-set",
"objectType":"Activity"
}
]
}
},
"object":{
"id":"https://h5p.org/single-choice-set?subContentId=95b60491-e203-4bc5-956c-89e966b1005d",
"objectType":"Activity",
"definition":{
"description":{
"en-US":"Goji berries are native to ..."
},
"interactionType":"choice",
"correctResponsesPattern":[
"0"
],
"type":"http://adlnet.gov/expapi/activities/cmi.interaction",
"choices":[
{
"id":"0",
"description":{
"en-US":"Asia"
}
},
{
"id":"1",
"description":{
"en-US":"Africa"
}
},
{
"id":"2",
"description":{
"en-US":"Europe"
}
}
],
"extensions":{
"http://h5p.org/x-api/h5p-local-content-id":1515,
"http://h5p.org/x-api/h5p-subContentId":"95b60491-e203-4bc5-956c-89e966b1005d"
}
}
},
"result":{
"response":"",
"duration":"PT0S",
"score":{
"raw":0,
"min":0,
"max":1,
"scaled":0
}
}
}
},
{
"statement":{
"actor":{
"name":"user",
"mbox":"mailto:user@mail.com",
"objectType":"Agent"
},
"verb":{
"id":"http://adlnet.gov/expapi/verbs/answered",
"display":{
"en-US":"answered"
}
},
"context":{
"contextActivities":{
"parent":[
{
"id":"https://h5p.org/single-choice-set",
"objectType":"Activity"
}
]
}
},
"object":{
"id":"https://h5p.org/single-choice-set?subContentId=aa694288-df4d-4ed3-8f81-f47fa3d27fe4",
"objectType":"Activity",
"definition":{
"description":{
"en-US":"Goji berries are usually sold ..."
},
"interactionType":"choice",
"correctResponsesPattern":[
"0"
],
"type":"http://adlnet.gov/expapi/activities/cmi.interaction",
"choices":[
{
"id":"0",
"description":{
"en-US":"Dried"
}
},
{
"id":"1",
"description":{
"en-US":"Pickled"
}
},
{
"id":"2",
"description":{
"en-US":"Frozen"
}
}
],
"extensions":{
"http://h5p.org/x-api/h5p-local-content-id":1515,
"http://h5p.org/x-api/h5p-subContentId":"aa694288-df4d-4ed3-8f81-f47fa3d27fe4"
}
}
},
"result":{
"response":"",
"duration":"PT0S",
"score":{
"raw":0,
"min":0,
"max":1,
"scaled":0
}
}
}
}
]
}
License
(The MIT License)
Copyright (c) 2016 Joubel AS
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
haggag/h5p-report 适用场景与选型建议
haggag/h5p-report 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「content」 「quiz」 「interactive」 「h5p」 「hvp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 haggag/h5p-report 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 haggag/h5p-report 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 haggag/h5p-report 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A block that displays featured content - large image, title, description and link.
Create and add rich content to your website for free. Some examples of what you get with H5P are Interactive Video, Quizzes, Collage and Timeline.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
Interactive debug shell for eZ Publish 5+ apps. Uses PsySH.
yii2 interactive console with smart autocomplete and context workflow
An interactive tour through the TYPO3 backend.
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2024-08-06