Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents

Base Functions

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

LMSInitialize()

Inputs: None
Returns: CMIBoolean true if the initialization was successful, or
                CMIBoolean false if the initialization 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

ValidateInput(cmiElementName)

...

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

Getters

...

GetLessonStatus (coursePath, shortId, studentId)

Inputs: nonecoursePath -> course path,
             shortId -> identificator
             studentId -> student Guid
Returns: objective childrenlesson status if correctly stored

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

...

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

GetObjectiveChildren()

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

children always returns "id,score,status"

GetObjectiveShortId(coursePath, shortId, studentId)

...

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

...

GetObjectiveCount(

...

)

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 statenone
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)

GetOutOf(coursePath, shortId, studentId)

...

Inputs: coursePath -> course path,
            SCOId -> identificator
            studentId -> student Guid
Returns: The comments for the SCO course

Description:

Setters

...

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

GetUsersTotal(coursePath, shortId,

...

studentId)

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

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

Setters

SetLessonLocation(coursePath, SCOId, studentId, value)

Inputs: coursePath -> course path,
            SCOId -> identificator
            studentId -> student Guid
            value - lesson location
Returns: true if correctly stored otherwise false

Description: Sets location of a lesson (cmi.core.lesson_location) 

SetLessonStatus(coursePath, shortId, status)

...

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

SetLessonLocation(coursePath, SCOId, studentId, value)

Inputs: coursePath -> course path,
            SCOId -> identificator
            studentId -> student Guid
            value - lesson location
Returns: true if correctly stored otherwise false

Description: Sets location of a lesson (cmi.core.lesson_location) 

SetSCOSuspendData (coursePath, SCOId, studentId, value)

...

Description: Sets Student's property

Helper Functions

...

SetUsersTotal (coursePath, shortId, newScore)

Inputs: SCORMErrorCodecoursePath -> course path,
             statusCodeshortId -> identificator
             Message
             StackTrace
Returns: noneDescription: sets API.private member variables to the specified error valuesnewScore - UsersTotal (cmi.core.score.raw) 
Returns: true if correctly stored otherwise false

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

Helper Functions

clearError()

Inputs: none
Returns: none

...

Inputs: url - API url,
            method - GET or POST,
            hasBoolResult - if the caller wants to a 'true' or 'false' return, or a result or an empty string?? 
            params - object that represents parameters that need to be sent to server
Returns: response or empty string '' if error happend

Description: calls server API methods (wrapper for Jquery ajax call)

findId(storeName, n)

Inputs: storeName - storage name
            'n' variable
Returns: undefined

Description: Tries to find id/n combination by 'n' variable in specific local storage (Can be multiple, for example interactions or objectives).

getChildrenFromServerResults(results)

Inputs: results - data array from server
Returns: SCORM definition of children objects (always returns "id,score,status")

Description: Map server children objects to SCORM children objects

parseCmi(cmiElementName, value)

Inputs: cmiElementName - cmi name
             value - value to be set
Returns: true if correctly stored otherwise false
Description: Parse cmiElementName to be able to define shortId. (Specs:

Jira Legacy
serverSystem JIRA
serverId23f523ea-1678-3ca2-a1e8-2de53fd3b74a
keyCOREDEV-1219
) Regular expressions is used for getting group name and modify cmi string for switch statement because the cmi contains value of 'n' variable.

storeId(storeName, shortId)

Inputs: storeName - storage name             shortId - server side shortId that contains information about id and 'n' variable
Returns: undefined
Description: Stores id / 'n' combinations for preventing too many server requests. There can be multiple storages (objectives, interactions).

parseShortId(shortId)

Inputs: shortId - shortId that contains id/n
Returns: object that constains property: id, n

Description: Parses shortId string to get property: id & n

...

setError(SCORMErrorCode, statusCode, Message, StackTrace)

Inputs: SCORMErrorCode
             statusCode
             Message
             StackTrace
Returns: none

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

storeId(storeName,

...

shortId)

Inputs: storeName - storage name
             shortId - server side shortId that contains information about id and 'n' variable
Returns: undefined

Description: Tries to find Stores id / n combination by 'n' variable in specific local storage (Can be multiple, for example interactions or objectives).

getChildrenFromServerResults(results)

Inputs: results - data array from server
Returns: SCORM definition of children objects (always returns "id,score,status")
Description: Map server children objects to SCORM children objectscombinations for preventing too many server requests. There can be multiple storages (objectives, interactions).