Built-In Namespace _global_
Field Attributes | Field Name and Description |
---|---|
instanciate the EventTracer object
|
|
<constant> |
This object is used for a convenience translation of the differents states
|
instanciate the TaoStack object
|
|
<constant> |
This object is used for a convenience translation of URIS
the ##NAMESPACE# tag means the local namespace
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
afterFinish(callback)
Add a callback that will be executed on finish but after the other callbacks
|
|
beforeFinish(callback)
Add a callback that will be executed on finish but before the other callbacks
|
|
finish()
Define the item's state as finished.
|
|
Get the values answered by the subject
|
|
Get the informations of the current delivery
|
|
Get the endorsment of the item
|
|
getItem()
Get the current item's informations
|
|
getScore()
Get the score of the item
|
|
get the score range if defined
|
|
Get the data of the user currently doing the item (the subject)
|
|
Get the login of the subject
|
|
Get the name of the subject (firstname and lastname)
|
|
getTest()
Get the informations of the currently running test
|
|
getToken()
Get the communication token (this token is sent at each communication)
|
|
getUserVar(key)
Get a previously defined user's variable.
|
|
initDataSource(environment, settings)
This fuction enables you to set up the data the item need.
|
|
initEventServices(source, destination)
Initialize the interfaces communication for the events logging.
|
|
initManualDataSource(source)
This function is a convenience method to add directly the datasource
by writing the data in the source object (JSON) .
|
|
initPush(environment, settings)
Initialize the push communication.
|
|
isScalar(value)
Utility function to check if a value is a scalar:
(string, integer, float and boolean)
|
|
logCustomEvent(eventName, data)
Log the a eventName by sending the data
|
|
logEvent(elementName, eventType, data)
Log the an eventType bound on elementName by sending the data.
|
|
onFinish(callback)
Add a callback that will be executed on finish state.
|
|
push()
This method enables you to push the data to the server.
|
|
setAnsweredValues(values)
Set the values answered by the subject.
|
|
setEndorsment(endorsment)
Set the endorsment of the item
|
|
setScore(score)
Set the final score of the item
|
|
setScoreRange(max, min)
Set the score range.
|
|
setUserVar(key, the)
This function enables you to create and edit custom variables: the user's variables
The variable is identified by a key you have chosen.
|
Field Detail
{EventTracer}
eventTracer
instanciate the EventTracer object
Defined in: api.js.
Defined in: api.js.
<constant>
STATE
This object is used for a convenience translation of the differents states
Defined in: constants.js.
Defined in: constants.js.
taoStack
instanciate the TaoStack object
Defined in: api.js.
Defined in: api.js.
<constant>
URI
This object is used for a convenience translation of URIS
the ##NAMESPACE# tag means the local namespace
Defined in: constants.js.
Defined in: constants.js.
Method Detail
-
afterFinish(callback)Add a callback that will be executed on finish but after the other callbacks
Defined in: api.js.- Parameters:
- {function} callback
-
beforeFinish(callback)Add a callback that will be executed on finish but before the other callbacks
Defined in: api.js.- Parameters:
- {function} callback
-
finish()Define the item's state as finished. This state can have some consequences.
Defined in: api.js. -
{Object} getAnsweredValues()Get the values answered by the subject
Defined in: api.js.- Returns:
- {Object}
-
{Object} getDelivery()Get the informations of the current delivery
Defined in: api.js.- Returns:
- {Object} the delivery's data (uri, label)
-
{boolean} getEndorsment()Get the endorsment of the item
Defined in: api.js.- Returns:
- {boolean}
-
{Object} getItem()Get the current item's informations
Defined in: api.js.- Returns:
- {Object} the item's data (uri, label)
-
{String|Number} getScore()Get the score of the item
Defined in: api.js.- Returns:
- {String|Number}
-
{Object} getScoreRange()get the score range if defined
Defined in: api.js.- Returns:
- {Object} with min and max attributes
-
{Object} getSubject()Get the data of the user currently doing the item (the subject)
Defined in: api.js.- Returns:
- {Object} all the data related to the subject
-
{String} getSubjectLogin()Get the login of the subject
Defined in: api.js.- Returns:
- {String} the subject's login
-
{Object} getSubjectName()Get the name of the subject (firstname and lastname)
Defined in: api.js.- Returns:
- {Object} the subject's name
-
{Object} getTest()Get the informations of the currently running test
Defined in: api.js.- Returns:
- {Object} the test's data (uri, label)
-
{String} getToken()Get the communication token (this token is sent at each communication)
Defined in: api.js.- Returns:
- {String} the token
-
{String|number|boolean} getUserVar(key)Get a previously defined user's variable.
Defined in: api.js.- Parameters:
- {String} key
- the key of the variable you want to retrieve
- Returns:
- {String|number|boolean}
-
initDataSource(environment, settings)This fuction enables you to set up the data the item need. You can retrieve this data from either a remote or a manual source. If you don't need to change the default values, don't call this function.
Defined in: api.js.- Parameters:
- {Object} environment
- set to null if you want to keep all the default values
- {String} environment.type Optional, Default: "async"
- the datasource type (manual|sync|async)
- {String} environment.url Optional, Default: "/taoDelivery/ResultDelivery/initialize"
- the url of the server where the data are sent
- {Object} environment.params Optional
- the additional parameters to send with the data
- {Object} settings
- set to null if you want to keep all the default values
- {String} settings.format Optional, Default: "json"
- the data format. Only json is supported in the current version
- {String} settings.method Optional, Default: "post"
- HTTP method to push the data (get|post)
-
initEventServices(source, destination)Initialize the interfaces communication for the events logging. The source service defines where and how we retrieve the list of events to catch The destination service defines where and how we send the catched events
Defined in: api.js.- Parameters:
- {Object} source
- {String} source.type Optional, Default: "sync"
- the type of source (sync|manual)
- {Object} source.data Optional
- For the manual source type, set direclty the events list in the data
- {String} source.url Optional, Default: "/taoDelivery/ResultDelivery/getEvents"
- For the sync source type, the URL of the remote service
- {Object} source.params Optional
- the parameters to send to the sync service
- {String} source.format Optional, Default: "json"
- the data format. Only json is supported in the current version
- {String} source.method Optional, Default: "post"
- HTTP method of the sync service (get|post)
- {Object} destination
- {String} destination.url Optional, Default: "/taoDelivery/ResultDelivery/traceEvents"
- the URL of the remote service
- {Object} destination.params Optional
- the common parameters to send to the service
- {String} destination.format Optional, Default: "json"
- the data format. Only json is supported in the current version
- {String} destination.method Optional, Default: "post"
- HTTP method of the service (get|post)
-
initManualDataSource(source)This function is a convenience method to add directly the datasource by writing the data in the source object (JSON) .
Defined in: api.js.- Parameters:
- {Object} source
-
initPush(environment, settings)Initialize the push communication. If you don't need to change the default values, don't call this function.
Defined in: api.js.- Parameters:
- {Object} environment
- set to null if you want to keep all the default values
- {String} environment.url Optional, Default: "/taoDelivery/ResultDelivery/save"
- the url of the server where the data are sent
- {Object} environment.params Optional
- the additional parameters to send with the data
- {Object} settings
- set to null if you want to keep all the default values
- {String} settings.format Optional, Default: "json"
- the data format. Only json is supported in the current version
- {String} settings.method Optional, Default: "post"
- HTTP method to push the data (get|post)
- {boolean} settings.async Optional, Default: true
- if the request is asynchronous
- {boolean} settings.clearAfter Optional, Default: true
- if the variables stacks are cleared once the push is done
-
{bool} isScalar(value)Utility function to check if a value is a scalar: (string, integer, float and boolean)
Defined in: core.js.- Parameters:
- {mixed} value
- Returns:
- {bool} true if it's a scalar
-
logCustomEvent(eventName, data)Log the a eventName by sending the data
Defined in: api.js.- Parameters:
- {String} eventName
- the name of the custom event
- {mixed} data
-
logEvent(elementName, eventType, data)Log the an eventType bound on elementName by sending the data.
Defined in: api.js.- Parameters:
- {String} elementName
- an HTML tag name
- {String} eventType
- a JS User Events
- {mixed} data
- any data strucuture you want to trace
-
onFinish(callback)Add a callback that will be executed on finish state.
Defined in: api.js.- Parameters:
- {function} callback
-
push()This method enables you to push the data to the server.
Defined in: api.js. -
setAnsweredValues(values)Set the values answered by the subject. If the item contains a free text field, you can record here the complete response.
Defined in: api.js.- Parameters:
- {Object} values
-
setEndorsment(endorsment)Set the endorsment of the item
Defined in: api.js.- Parameters:
- {boolean} endorsment
-
setScore(score)Set the final score of the item
Defined in: api.js.- Parameters:
- {String|Number} score
-
setScoreRange(max, min)Set the score range. It will be used to calculate the endorsment from the score.
Defined in: api.js.- Parameters:
- {String|Number} max
- {String|Number} min Optional, Default: 0
-
setUserVar(key, the)This function enables you to create and edit custom variables: the user's variables The variable is identified by a key you have chosen. This variable will be saved temporarly into the taoApi. When you call the
push()
function, the user's variables are sent to the server. It's a way to record some data other than the results and the events.
Defined in: api.js.- Parameters:
- {String} key
- to identify of the variable
- {String|number|boolean} the
- value of the variable