Constructor
new ExperimentHandler(options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Extends
- PsychObject
Members
(static, readonly) Environment :Symbol
- Source:
Properties:
Name | Type | Description |
---|---|---|
SERVER |
Symbol | |
LOCAL |
Symbol |
Experiment environment.
Type:
- Symbol
(static, readonly) SaveFormat :Symbol
- Source:
Properties:
Name | Type | Description |
---|---|---|
CSV |
Symbol | Results are saved to a .csv file |
DATABASE |
Symbol | Results are saved to a database |
Experiment result format
Type:
- Symbol
_thisEntry
- Source:
Legacy experiment getters.
experimentEnded
- Source:
Getter for experimentEnded.
experimentEnded
- Source:
Setter for experimentEnded.
Methods
(protected, static) _getLoopAttributes(loop)
- Source:
Get the attribute names and values for the current trial of a given loop.
Only info relating to the trial execution are returned.
Parameters:
Name | Type | Description |
---|---|---|
loop |
Object | the loop |
addData(key, value)
- Source:
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 |
addLoop(loop)
- Source:
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 |
isEntryEmpty() → {boolean}
- Source:
- To Do:
-
- This really should be renamed: IsCurrentEntryNotEmpty
Whether or not the current entry (i.e. trial data) is empty.
Note: this is mostly useful at the end of an experiment, in order to ensure that the last entry is saved.
Returns:
whether or not the current entry is empty
- Type
- boolean
nextEntry(snapshots)
- Source:
Inform this ExperimentHandler that the current trial has ended. Further calls to addData
will be associated with the next trial.
Parameters:
Name | Type | Description |
---|---|---|
snapshots |
Object | Array.<Object> | undefined | array of loop snapshots |
removeLoop(loop)
- Source:
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 |
(async) save(options)
- Source:
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
|