Skip to end of banner
Go to start of banner

SCORM API Reference

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Version History

« Previous Version 3 Next »

The SCORM API is slightly different than the standard in that there is a javascript layer that calls the controller (MarineLMS-SCORM-API.js).  The controller endpoints are still documented as of version 4.0, available on the API help page (e.g. https://demo.marinels.com/help), however these are not directly called, except by the aforementioned .js file.  

For versions before 4.0 the following can be used as reference (however not all of the endpoints have been implemented/tested):

LMSInitialize()

Inputs: None
Returns: CMIBoolean true if the initialization was successful, or
                CMIBoolean false if the initialization failed.

Description:
Initialize communication with LMS by calling the LMSInitialize function which will be implemented by the LMS. This function also gets the SCO id by grabbing the last token of the path in the iframe and adds it to the SCOIDMapping object.

ValidateInput(cmiElementName)

Inputs: cmiElementName
Returns: none

Description:
Check input to see if it fits the convention for cmi Element Names

ValidateInitialize()

Inputs: None
Returns: False if LMS not initialized
                Else return true

Description:
Check if LMS has been initialized. Return error if LMS has not been initialized. Else return true

LMSFinish()

Inputs: None
Returns: CMIBoolean true if successful
               CMIBoolean false if failed.

Description:
Close communication with LMS by calling the LMSFinish function which will be implemented by the LMS

LMSGetValue(name)

Inputs: name - string representing the cmi data model defined category or element (e.g. cmi.core.student_id)
Returns: The value presently assigned by the LMS to the cmi data model element defined by the element or category identified by the name input value.

Description:
Wraps the call to the LMS LMSGetValue method

LMSSetValue(cmiElementName, value)

Inputs: cmiElementName -string representing the data model defined category or element
             value -the value that the named element or category will be assigned
Returns: CMIBoolean true if successful
CMIBoolean false if failed.

Description:
Wraps the call to the LMS LMSSetValue function

LMSCommit() - Not Implemented?

Inputs: None
Returns: None

Description: Call the LMSCommit function

LMSGetLastError()

Inputs: None
Returns: The error code that was set by the last LMS function call

Description:
Call the LMSGetLastError function

LMSGetErrorString(errorCode)

Inputs: errorCode - Error Code
Returns: The textual description that corresponds to the input error code

Description:
Call the LMSGetErrorString function

  • 0     - No Error
  • 101 - General Exception
  • 201 - Invalid Argument Error
  • 202 - Element cannot have children
  • 203 - Element not an array. Cannot have count.
  • 301 - Not initialized
  • 401 - Not implemented error
  • 402 - Invalid set value, element is a keyword
  • 403 - Element is read only
  • 404 - Element is write only
  • 405 - Incorrect Data Type

LMSGetDiagnostic(errorCode)

Inputs: errorCode - Error Code(integer format), or null
Returns: The vendor specific textual description that corresponds to the input error code

Description:
Call the LMSGetDiagnostic function

setError(SCORMErrorCode, statusCode, Message, StackTrace)

Inputs: SCORMErrorCode
             statusCode
             Message
             StackTrace
Returns: none

Description: sets API.private member variables to the specified error values

clearError()

Inputs: none
Returns: none

Description: Clears the values of the members of the API.private object

GetObjectiveChildren()

Inputs: none
Returns: objective children

Description: get objective children always returns "id,score,status"

GetObjectiveCount()

Inputs: none
Returns: objective children count

Description: get objective children count returns the number of objective level assessments stored for this objective ("-Score" and "-Status" only count as 1)

GetStudent()

Inputs: arguments - properties that should be returned (if no args define then return entire user)
Returns: current user props (format: prop1, prop2, prop3, ...)

Description: gets the current user props

GetObjectiveShortId(coursePath, shortId, studentId)

Inputs: coursePath -> course path,
             shortId -> identificator (SCO.Id + '.' + n)
             studentId -> student Guid
Returns: shortId  (cmi.core.score.n.id?)

Description: Defines assessment name for objective 'n' (needs to be held as state in API object)

GetUsersTotal(coursePath, shortId, studentId)

Inputs: coursePath -> course path,
             shortId -> identificator
             studentId -> student Guid
Returns: userTotal if correctly stored (cmi.core.score.raw)

Description: Assessment Short Id = SCO.Id + "-Score", stored in the UsersTotal property of the student result audit state

GetLessonStatus (coursePath, shortId, studentId)

Inputs: coursePath -> course path,
             shortId -> identificator
             studentId -> student Guid
Returns: lesson status if correctly stored

Description: Assessment Short Id = SCO.Id + "-Status", stored in the UsersTotal property of the student result audit state

GetOutOf(coursePath, shortId, studentId)

Inputs: coursePath -> course path,
             shortId -> identificator
             studentId -> student Guid
Returns: outOf if correctly stored (cmi.core.score.max)

Description: Assessment name = SCO.Id + "-Score", stored in the OutOf property of the student result audit state

SetStudent(prop, value) - TODO verify return

Inputs: prop - property to be set
             value - property value
Returns: sets the student if correctly stored, otherwise returns false

Description: Sets Student's property

GetSCOEntry (coursePath, SCOId, studentId)

Inputs: coursePath -> course path,
             SCOId -> identificator
             studentId -> student Guid
Returns: the SCO Data or empty string if none exists

Description: Initializes the SCO Entry if none exists then returns an empty string. Actually more of a CreateOrUpdate (poor naming)

GetSCOTotalTime (coursePath, SCOId, studentId)

Inputs: coursePath -> course path,
            SCOId -> identificator
            studentId -> student Guid
Returns: Gets the total time for the SCO Entry

Description: Gets the total time for the course for the student result audit based on the course path, SCO id, and student id (Guid)

GetSCOLessonLocation(coursePath, SCOId, studentId)

Inputs: coursePath -> course path,
            SCOId -> identificator
            studentId -> student Guid
Returns: Gets the lesson location from the SCO data (cmi.core.lesson_location - r/w opaque field.)

Description: Lesson location as string.






0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.