eLabSDK.Experiment Class
Class that allows to manipulate the Experiment Page
Constructor
eLabSDK.Experiment
(
async
-
object
Parameters:
-
object
Object-
experimentID
Int- New experiment will be created if not provided
-
onLoaded
Function- 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:
-
configObject
Obj-
header
String- Section Header Text
-
type
eLabSDK.Experiment.Section.SECTIONTYPE- Section Type
-
-
onCreated
Function
getExperimentID
()
Int
Returns:
Int:
experimentID
getSection
(
eLabSDK.Experiment.Section
-
sectionID
Gets the section object by ID
Parameters:
-
sectionID
Type
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');
});