eLabSDK.Experiment Class
Class that allows to manipulate the Experiment Page
Constructor
eLabSDK.Experiment
(
async
-
object
Parameters:
-
objectObject-
experimentIDInt- New experiment will be created if not provided
-
onLoadedFunction- Include your code here due to the aSync nature of this class
-
Example:
-
var experiment = new eLabSDK.Experiment({ experimentID: 123, onLoaded: function(){ console.log(this.data); } }); // Creating an experiment: var newExp = new eLabSDK.Experiment({ name: 'SDK test', studyID: 123, onCreated: function(){ console.log('created experiment with ID: ' + newExp.options.experimentID); } });
Item Index
Properties
Methods
addSection
(
-
configObject -
onCreated
Adds a section to this experiment
Parameters:
-
configObjectObj-
headerString- Section Header Text
-
typeeLabSDK.Experiment.Section.SECTIONTYPE- Section Type
-
-
onCreatedFunction
getExperimentID
()
Int
Returns:
Int:
experimentID
getSection
(
eLabSDK.Experiment.Section
-
sectionID
Gets the section object by ID
Parameters:
-
sectionIDType
Returns:
eLabSDK.Experiment.Section:
section or null of it doest not exist
getStudyID
()
Int
Returns:
Int:
studyID
Properties
sections
Array
Array of eLabSDK.Experiment.Section Sections of experiment
Events
onCreated
Use this to access class
Example:
var ev = experimentObject.onCreated(function () {
alert('Experiment created');
});
onLoaded
Use this to access class
Example:
var ev = experimentObject.onLoaded(function () {
alert('Experiment onLoaded');
});
