动词不显示xAPI语句

时间:2015-12-25 14:13:33

标签: javascript json tin-can-api

当我发送此示例语句时,当我查看LRS中的信息时,动词未显示。演员和其他信息正确显示。谁能告诉我我可能做错了什么?谢谢。

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple Statement</title>
<script src="js/tincan.js" type="text/javascript"></script>
<script type="text/javascript">

function init()
        {

var tincan = new TinCan (
    {
        recordStores: [
            {
                endpoint: "https://lrs.adlnet.gov/xapi/",
                username: "xapi-tools",
                password: "xapi-tools",
                allowFail: false
            }
        ]
    }
);

tincan.sendStatement(
    {
        actor: {
            mbox: "mailto:myemailaddress@example.com"
        },
        verb: {
            id: "http://adlnet.gov/expapi/verbs/attempted"
        },
        target: {
            id: "http://tincanapi.com/activities/sending-my-first-statement"
        }
    },
    function (err, result) {
        //Handle any errors here. This code just outputs the result to the page. 
        document.write("<pre>");
        document.write(JSON.stringify(err, null, 4));
        document.write("</pre>");
        document.write("<pre>");
        document.write(JSON.stringify(result, null, 4));
        document.write("</pre>");
    }
);
        }
</script>

</head>

<body onload='init()'>

1 个答案:

答案 0 :(得分:1)

很可能没什么。您的声明可以通过提供“显示”属性并在其中包含一个或多个语言代码/值对来“改进”,以便该语句包含该对象的“人类可读”版本。我认为TinCanJS会为你做这个动词。