Constructor
new PsychoJS(options)
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
Members
(static, readonly) Environment :Symbol
Experiment environment.
Type:
- Symbol
Properties:
Name | Type | Description |
---|---|---|
SERVER |
Symbol | |
LOCAL |
Symbol |
- Source:
(static, readonly) Status :Symbol
PsychoJS status.
Type:
- Symbol
Properties:
Name | Type | Description |
---|---|---|
NOT_CONFIGURED |
Symbol | |
CONFIGURING |
Symbol | |
CONFIGURED |
Symbol | |
NOT_STARTED |
Symbol | |
STARTED |
Symbol | |
FINISHED |
Symbol | |
STOPPED |
Symbol |
- Source:
status
Properties
- Source:
Methods
(protected) _captureErrors()
Capture all errors and display them in a pop-up error box.
- Source:
(async, protected) _configure(configURL, name)
Configure PsychoJS for the running experiment.
Parameters:
Name | Type | Description |
---|---|---|
configURL |
string | the URL of the configuration file |
name |
string | the name of the experiment |
- Source:
(async, protected) _getParticipantIPInfo()
Get the IP information of the participant, asynchronously.
Note: we use http://www.geoplugin.net/json.gp.
- Source:
(async) downloadResources(resourcesopt)
Synchronously download resources for the experiment.
- For an experiment running locally: the root directory for the specified resources is that of index.html unless they are prepended with a protocol, such as http:// or https://.
- For an experiment running on the server: if no resources are specified, all files in the resources directory of the experiment are downloaded, otherwise we only download the specified resources.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resources |
Array.<{name: string, path: string}> |
<optional> |
[] | the list of resources |
- Source:
getEnvironment() → {PsychoJS.Environment|undefined}
Get the experiment's environment.
- Source:
Returns:
the environment of the experiment, or undefined
- Type
- PsychoJS.Environment | undefined
importAttributes(obj)
Make the attributes of the given object those of PsychoJS and those of
the top level variable (e.g. window) as well.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object.<string, *> | the object whose attributes we will mirror |
- Source:
openWindow(options)
Open a PsychoJS Window.
This opens a PIXI canvas.
Note: we can only open one window.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
Throws:
-
exception if a window has already been opened
- Type
- Object.<string, *>
(async) quit(options)
Close everything and exit nicely at the end of the experiment,
potentially redirecting to one of the URLs previously specified by setRedirectUrls.
Note: if the resource manager is busy, we inform the participant that he or she needs to wait for a bit.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
schedule(task, args)
Schedule a task.
Parameters:
Name | Type | Description |
---|---|---|
task |
the task to be scheduled | |
args |
arguments for that task |
- Source:
scheduleCondition(condition, thenScheduler, elseScheduler)
Schedule a series of task based on a condition.
Parameters:
Name | Type | Description |
---|---|---|
condition |
PsychoJS.condition | |
thenScheduler |
Scheduler | scheduler to run if the condition is true |
elseScheduler |
Scheduler | scheduler to run if the condition is false |
- Source:
setRedirectUrls(completionUrl, cancellationUrl)
Set the completion and cancellation URL to which the participant will be redirect at the end of the experiment.
Parameters:
Name | Type | Description |
---|---|---|
completionUrl |
string | the completion URL |
cancellationUrl |
string | the cancellation URL |
- Source:
(async) start(options)
Start the experiment.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source: