Class: ExperimentHandler

data.ExperimentHandler(options)

new ExperimentHandler(options)

An ExperimentHandler keeps track of multiple loops and handlers. It is particularly useful for generating a single data file from an experiment with many different loops (e.g. interleaved staircases or loops within loops.

Parameters:
Name Type Description
options Object
Properties
Name Type Description
psychoJS PsychoJS the PsychoJS instance
name string name of the experiment
extraInfo Object additional information, such as session name, participant name, etc.
Source:

Extends

  • PsychObject

Methods

(protected) _getLoopAttributes(loop)

Get the attribute names and values for the current trial of a given loop.

Only only info relating to the trial execution are returned.

Parameters:
Name Type Description
loop Object the loop
Source:

addData(key, value)

Add the key/value pair.

Multiple key/value pairs can be added to any given entry of the data file. There are considered part of the same entry until a call to nextEntry is made.

Parameters:
Name Type Description
key Object the key
value Object the value
Source:

addLoop(loop)

Add a loop.

The loop might be a TrialHandler, for instance.

Data from this loop will be included in the resulting data files.

Parameters:
Name Type Description
loop Object the loop, e.g. an instance of TrialHandler or StairHandler
Source:

nextEntry()

Inform this ExperimentHandler that the current trial has ended. Further calls to addData will be associated with the next trial.
Source:

removeLoop(loop)

Remove the given loop from the list of unfinished loops, e.g. when it has completed.
Parameters:
Name Type Description
loop Object the loop, e.g. an instance of TrialHandler or StairHandler
Source:

save(options)

Save the results of the experiment.
  • For an experiment running locally, the results are offered for immediate download.
  • For an experiment running on the server, the results are uploaded to the server.

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Description
attributes Array.<Object> <optional>
the attributes to be saved
Source: