Skip to content

HTML Code Snippets

LRS Information

  • Endpoint: https://saas.learninglocker.net/data/xAPI
  • Username: 99388b5387b7e024c319a0b46cf5fdbbcc141ec0
  • Password: f7617670111b294f3647b9054a8b3405824887df

Head Section

<script type="text/javascript" src="js/tincan.js"></script>
<script type="text/javascript" src="js/common.js"></script>

<script type="text/javascript">
		var actor1 = {
	"mbox": sessionStorage.email,
	"name": sessionStorage.actorname
}

<!-- Sets the page object information for the current page. -->
var pageObj = {
                "id":"http://www.yourdomain.com/index_button.html",
	"definition":{
	    "name":{"en-US":"Test xAPI Page 2"},
	    "description":{"en-US":"Page to test the xAPI on a button."}
				}
}

<!--Sets the object information for the image button. -->
var pageObj2 = {
                "id":"http://www.yourdomain.com/index_button.html",
"definition":{
	"name":{"en-US":"Start Button"},
	"description":{"en-US":"Page to test the xAPI on a button."}
	     }
}
</script>
		<script>
			tincan.sendStatement(
    {
        actor: actor1,
        verb: {
       id: "http://adlnet.gov/expapi/verbs/experienced"
        },
        target: pageObj,
    }
);
		</script>
		<script type="text/javascript">
			function xapiStatement(){
			tincan.sendStatement(
				{
		actor: actor1,	
verb: {
						id:"http://adlnet.gov/expapi/verbs/clicked",
	display:{"en-US":"clicked"	
						}
					},
	target: pageObj2,
				}
			);
		}
		</script>

Body Section

onClick="xapiStatement()"


Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.