Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 1.7 KB

xapi-data-book-minimal.md

File metadata and controls

37 lines (31 loc) · 1.7 KB

% xapi-data-statement-minimal epub % Tyler Mulligan % April 24, 2014

click to send a shared statement to the ADL LRS

Statement Response


<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript" src="http://z2.vc/xapi/html5-data-attributes/js/xapiwrapper.min.js"></script>
<script type="text/javascript">
	$(function(){
		// apply default LRS config
		ADL.XAPIWrapper.changeConfig({
		  "endpoint" : "https://lrs.adlnet.gov/xapi/",
		  "user" : "ebook",
		  "password" : "ebooklrs"
		});
		$('#send-statement').click(function (e) {
			e.preventDefault();
		// don't get crazy with the sizzle
		var $el = $(this);
		
		// get the xapi-statement from the data atrribute
		var stmt = $el.attr('data-xapi-statement');
		var xstmt = $.parseJSON(stmt);

		ADL.XAPIWrapper.sendStatement(xstmt, function(resp, obj) {
			$("#statement-response").html(resp.status + ": " + obj.id);
		});
	});
});
</script>

What?

You can view the statement on the ADL LRS Statement Viewer