代码拉取完成,页面将自动刷新
<!doctype html>
<head>
<!-- Includes for ADL's xAPI Wrapper -->
<!-- Download the files from: -->
<!-- https://github.com/adlnet/xAPIWrapper -->
<script type="text/javascript" src="./js/cryptojs_v3.1.2.js"></script>
<script type="text/javascript" src="./js/xapiwrapper.min.js"></script>
<!------------------------------------->
<script>
function send_statement(){
var conf = {
"endpoint" : "https://trial-lrs.yetanalytics.io/xapi/",
"auth" : "Basic " + toBase64("key:keyvalue")
};
ADL.XAPIWrapper.changeConfig(conf);
//define the xapi statement being sent
var statement = {
"actor": {
"mbox": "mailto:Tester@example.com",
"name": "fengxiang",
"objectType": "Agent"
},
"verb": {
"id": "http://example.com/xapi/interacted",
"display": {"en-US": "interacted"}
},
"object": {
"id": "http://example.com/button_example",
"definition": {
"name": {"en-US": "Button example"},
"description": {"en-US": "Example xAPI Button"}
},
"objectType": "Activity"
}
}; //end statement definition
// Dispatch the statement to the LRS
var result = ADL.XAPIWrapper.sendStatement(statement);
}
</script>
</head>
<body>
<button type="button" onclick="send_statement()">Send Statements</button>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。