eLABSDK V1.0

API Docs for: 1.0.0
Show:

eLabSDK.Experiment

Extends ELabSDK
Module: eLabSDK

Summary

Class that allows to manipulate the Experiment Page

Constructor

eLabSDK.Experiment

Syntax

eLabSDK.Experiment

(
  • object
)
async

Summary

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

Syntax

addSection

(
  • configObject
  • onCreated
)

Summary

Adds a section to this experiment

Parameters:

  • configObject Obj
    • header String
      • Section Header Text
    • type eLabSDK.Experiment.Section.SECTIONTYPE
      • Section Type
  • onCreated Function

getExperimentID

Syntax

getExperimentID

() Int

Summary

Returns:

Int:

experimentID

getSection

Syntax

getSection

(
  • sectionID
)
eLabSDK.Experiment.Section

Summary

Gets the section object by ID

Parameters:

  • sectionID Type

Returns:

eLabSDK.Experiment.Section:

section or null of it doest not exist

getStudyID

Syntax

getStudyID

() Int

Summary

Returns:

Int:

studyID

Properties

sections

Syntax

sections

Array

Summary

Array of eLabSDK.Experiment.Section Sections of experiment

Events

onCreated

Syntax

onCreated

Summary

Use this to access class

Example:

  var ev = experimentObject.onCreated(function () { 
                          alert('Experiment created'); 
                      });

onLoaded

Syntax

onLoaded

Summary

Use this to access class

Example:

  var ev = experimentObject.onLoaded(function () { 
                          alert('Experiment onLoaded'); 
                      });