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

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 or a StairHandler, 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:

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:

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.

Results are uploaded to the remote PsychoJS manager running on the remote https://pavlovia.org server

Parameters:
Name Type Description
options Object
Properties
Name Type Description
attributes PsychoJS the attributes to be saved
Source: