Javascript SCORM API

For anyone that’s tried to wade through the mountains of SCORM documentation it can be a little frusrating trying to put all the pieces together.

This is useful if you want to get interaction data out of products like Adobe Captivate, Adobe Presenter, or Articulate.

So I’m providing a very simple SCORM 2004 javascript API that will hopefully be a useful starting point for anyone trying to implement an LMS or SCORM data collector.

<script type="text/javascript">
	window["API_1484_11"] = {
		Initialize: function(parameter) {
 			console.log("Initialize: parameter=" + parameter);
			return "true";
 		},
		Commit: function(parameter) {
			console.log("Commit parameter=" + parameter);
			return "true";
		},
		Terminate: function(parameter) {
			console.log("Terminate parameter=" + parameter);
			return "true";
		},
		GetValue: function(parameter) {
			console.log("GetValue parameter=" + parameter);
			if (parameter.toLowerCase() == "cmi.completion_status")
				// Default response
				return "incomplete";
			return "";
		},
		SetValue: function(paremter_1,parameter_2)  {
			console.log("SetValue: paremter_1=" + paremter_1 + " | parameter_2=" + parameter_2);
			return "0";
		},
		GetErrorString: function() {
			console.log("GetErrorString");
			return "";
		},
		GetDiagnostic: function() {
			console.log("GetDiagnostic");
			return "";
		},
		GetLastError: function() {
			console.log("GetLastError");
			return "0";
		}				
	};
</script>

This script needs to be on the page that launches the SCORM compliant presentation.

Click here to download a demo presentation (MUST BE LAUNCHED FROM A WEBSERVER / WILL NOT WORK IF LAUNCHED DIRECTLY)

about me

An information technology professional with twenty one year's experience in systems administration, computer programming, requirements gathering, customer service, and technical support.