1.1.5 • Published 4 years ago
behavioral-task-trials v1.1.5
Behavioral Task Trials
All-in-one starter app with behavioral task trials
Modules
countdown
Builds a countdown transition with the given text and number of seconds.
Param | Type | Description |
---|---|---|
text | string | Optional text for the countdown. |
time | number | The number of seconds for the countdown. |
duration | number | The trial duration . |
responseEndsTrial | boolean | True if the trial ends on response,false if the trial waits for the duration. |
fixation
Builds a trial with a fixation dot and optional photodiode box.
Param | Type | Description |
---|---|---|
duration | number | The trial duration in milliseconds. |
config | object | The configuration object for USE_PHOTODIODE, USE_EEG, IS_ELECTRON and USE_MTURK flags. |
responseEndsTrial | boolean | True if the trial ends on response,false if the trial waits for the duration, by default false value. |
taskCode | number | Task code to be saved into data log and for pdSpotEncode, which by default is null and is passed when config has USE_PHOTODIODE set true. |
numBlinks | number | Number of times the pulse needs to be repeated for photodiode box, when USE_PHOTODIODE is set true. If not set, by default is 1. |
buttons | Array | This array contains the keys that the subject is allowed to press in order to respond to the stimulus. Keys can be specified as their numeric key code or as characters (e.g., 'a', 'q'). The default value of jsPsych.ALL_KEYS means that all keys will be accepted as valid responses. Specifying jsPsych.NO_KEYS will mean that no responses are allowed. If not set, by default is empty array. |
showEarnings
Builds a trial which shows formatted dollar earnings(number) with optional photodiode box.
Param | Type | Description |
---|---|---|
duration | number | The trial duration in milliseconds. |
config | object | The configuration object for USE_PHOTODIODE, USE_EEG, IS_ELECTRON and USE_MTURK flags. |
earnings | number | Float earnings to display on screen. If not set, default is random float. |
responseEndsTrial | boolean | True if the trial ends on response,false if the trial waits for the duration, by default false value. |
taskCode | number | Task code to be saved into data log and for pdSpotEncode, which by default is null and is passed when config has USE_PHOTODIODE set true. |
numBlinks | number | Number of times the pulse needs to be repeated for photodiode box, when USE_PHOTODIODE is set true. If not set, by default is 1. |
showMessage
Builds a trial with a onscreen message, optional buttons and optional phtodiode box
Param | Type | Description |
---|---|---|
duration | number | The trial duration in milliseconds. |
config | object | The configuration object for USE_PHOTODIODE, USE_EEG, IS_ELECTRON and USE_MTURK flags. |
message | string | Onscreen message to be shown in the trial, if not set default text is empty. |
responseEndsTrial | boolean | True if the trial ends on response,false if the trial waits for the duration, by default false value. |
taskCode | number | Task code to be saved into data log and for pdSpotEncode, which by default is null and is passed when config has USE_PHOTODIODE set true. |
numBlinks | number | Number of times the pulse needs to be repeated for photodiode box, when USE_PHOTODIODE is set true. If not set, by default is 1. |
buttons | Array | This array contains the keys that the subject is allowed to press in order to respond to the stimulus. Keys can be specified as their numeric key code or as characters (e.g., 'a', 'q'). The default value of jsPsych.ALL_KEYS means that all keys will be accepted as valid responses. Specifying jsPsych.NO_KEYS will mean that no responses are allowed. If not set, by default is empty array. |
userId
Builds a trial with set Id message and user Id input.
Param | Type | Description |
---|---|---|
duration | number | The trial duration in milliseconds. |
config | object | The configuration object for USE_PHOTODIODE, USE_EEG, IS_ELECTRON and USE_MTURK flags, by default only IS_ELECTRON is set to be true. |
setIdMessage | string | Onscreen text for setting user id or for the input box to enter patient id. |
responseEndsTrial | boolean | True if the trial ends on response,false if the trial waits for the duration, by default false value. |
REACT_APP_PATIENT_ID | boolean | The patient id to show when requesting a patient ID, if not set default is empty. |