springroll.pbskids.LearningAnalytics Class

Handle the Learning Analytics events

Constructor

springroll.pbskids.LearningAnalytics

(
  • [domain='http://progresstracker.pbskids.org']
  • [resource='game']
)

Parameters:

  • [domain='http://progresstracker.pbskids.org'] String optional

    The domain for the end-point this should only be set for mobile devices or testing otherwise it uses a root-relative end-point and will use the progresstracker on the current domain

  • [resource='game'] String optional

    The type of resource

appendChannelId

(
  • eventData
)
LearningAnalytics
private

Defined in appendChannelId:349

Adds the current super vision channel id to the event JSON data

Parameters:

  • eventData Object

    The event object data

Returns:

LearningAnalytics:

Instance for chaining

appendContentOrigin

(
  • eventData
)
LearningAnalytics
private

Adds the current Super Vision content origin to the event JSON data

Parameters:

  • eventData Object

    The event object data

Returns:

LearningAnalytics:

Instance for chaining

appendPlatformDetails

(
  • eventData
)
LearningAnalytics
private

Insert platform in JSON Data

Parameters:

  • eventData Object

    The event object data

Returns:

LearningAnalytics:

Instance for chaining

appendSessionId

(
  • eventData
)
LearningAnalytics
private

Defined in appendSessionId:293

Insert Game SessionId in JSON Data

Parameters:

  • eventData Object

    The event object

Returns:

LearningAnalytics:

Instance for chaining

appendTimeStamp

(
  • eventData
)
LearningAnalytics
private

Defined in appendTimeStamp:385

Add the timestamp to the event JSON data

Parameters:

  • eventData Object

    The event object data

Returns:

LearningAnalytics:

Instance for chaining

appendUserData

(
  • eventData
)
LearningAnalytics
private

Defined in appendUserData:320

Insert user information in JSON Data

Parameters:

  • eventData Object

    The event object data

Returns:

LearningAnalytics:

Instance for chaining

checkStatus

()
private

Defined in checkStatus:240

Check the online status internally on a timer Auto calling function to keep updating online staus

destroy

()

Defined in destroy:468

Cleanup and don't use after this

end

()

Defined in end:222

End the current queue

flushAll

()

Defined in flushAll:284

Flush the queue

pushEvent

(
  • eventData
)
Object

Defined in pushEvent:399

Push a learning event

Parameters:

  • eventData Object

    The event object data

    • game_id String

      The GUID for the game

    • event_id String

      The GUID for the event

    • event_data Object

      The data for event

Returns:

Object:

The event data with any appended data

resetSessionId

()

Defined in resetSessionId:213

Reset the current session id

validateEvent

(
  • eventData
)
Boolean
private

Defined in validateEvent:437

Validate Event JSON data

Parameters:

Returns:

Boolean:

if the event is valid

validateKaye

(
  • key
)
Boolean
private

Defined in validateKaye:456

Validate event data keys from EVENT_KEYS

Parameters:

Returns:

Boolean:

If the key is valid

_enabled

Boolean private

Defined in _enabled:116

Internal enabled boolean

Default: true

_timer

Int private

Defined in _timer:109

The setInterval ping to check online status

autoFlush

Boolean

Defined in autoFlush:231

If the queueing should autoflush

BATCH_SIZE

Int private static

Defined in BATCH_SIZE:157

The batch size of the queue

Default: 5

enabled

Boolean

Defined in enabled:251

If the tracking is enabled

Default: true

EVENT_KEYS

Object private static

Defined in EVENT_KEYS:167

JSON object keys for validation

eventKeys

Array private

Defined in eventKeys:73

The valid event keys for the resource type

KEY_PREFIX

String private static

Defined in KEY_PREFIX:131

The prefix for the event data

Default: 'PBS_event_'

platform

pbskids.Platform

Defined in platform:97

For getting platform details

queue

pbskids.BufferedQueue

Defined in queue:87

Queuing object for the event buffer

SERVICE_PATHS

Object private static

Defined in SERVICE_PATHS:141

The root-relative service URL pathing

sessionId

String

Defined in sessionId:103

This variable contains the Session Id for current play session.