API Docs for: 1.0.0
Show:

eLabSDK.Experiment Class

Extends ELabSDK
Module: eLabSDK

Class that allows to manipulate the Experiment Page

Constructor

eLabSDK.Experiment

(
  • object
)
async

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);
          }
     });

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

(
  • sectionID
)
eLabSDK.Experiment.Section

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'); 
                      });