|
From: <se...@us...> - 2008-05-06 09:41:37
|
Revision: 90
http://acmcontester.svn.sourceforge.net/acmcontester/?rev=90&view=rev
Author: sem62
Date: 2008-05-06 02:41:26 -0700 (Tue, 06 May 2008)
Log Message:
-----------
add file
Added Paths:
-----------
WebEditor/src/resources/api.js
Added: WebEditor/src/resources/api.js
===================================================================
--- WebEditor/src/resources/api.js (rev 0)
+++ WebEditor/src/resources/api.js 2008-05-06 09:41:26 UTC (rev 90)
@@ -0,0 +1,63 @@
+function Initialize(param)
+{
+ return document.player.Initialize(param);
+}
+
+function Terminate(param)
+{
+ return document.player.Terminate(param);
+}
+
+function SetValue(name,value)
+{
+ return document.player.SetValue(name, value);
+}
+function GetValue(name)
+{
+ return document.player.GetValue(name);
+}
+function Commit(param)
+{
+ var returnVal = document.player.Commit(param);
+ var status = GetValue("cmi.core.lesson_status");
+ if (status=="passed" || status=="failed")
+ navigation.location.reload();
+ return returnVal;
+}
+function GetLastError()
+{
+ return document.player.GetLastError();
+}
+function GetErrorString(code)
+{
+ return document.player.GetErrorString(code);
+}
+function GetDiagnostic(param)
+{
+ return document.player.GetDiagnostic(param);
+}
+function GetVersion()
+{
+ return "1.0 ";
+}
+
+var API = new Object(); //previous version support
+API.Initialize = Initialize;
+API.Terminate = Terminate;
+API.SetValue = SetValue;
+API.GetValue = GetValue;
+API.Commit = Commit;
+API.GetLastError = GetLastError;
+API.GetErrorString = GetErrorString;
+API.GetDiagnostic = GetDiagnostic;
+
+var API_1484_11 = new Object(); //SCORM 2004 support
+API_1484_11.Initialize = Initialize;
+API_1484_11.Terminate = Terminate;
+API_1484_11.SetValue = SetValue;
+API_1484_11.GetValue = GetValue;
+API_1484_11.Commit = Commit;
+API_1484_11.GetLastError = GetLastError;
+API_1484_11.GetErrorString = GetErrorString;
+API_1484_11.GetDiagnostic = GetDiagnostic;
+API_1484_11.version = GetVersion;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|