This repo implements the Auditory Conditioned Hallucinations (ACH) task with voice control cues. The task presents participants with a series of blocks, each containing trials with both auditory and visual stimuli, and exploits associative learning to induce auditory hallucinations, with cues to elicit, inhibit, or remain neutral toward these induced percepts. The fixation cross color cues these states, controlled at the mini-block level according to the in-person variant:
- Blocks 1 & 2: Use a constant fixation cross color (e.g.,
"default"). - Blocks 3, 4, 5: Use a block-specific order of fixation cross colors (e.g.,
"gray","green","red"), with the specific sequence randomized over mini-blocks, of which there are three per block.
The app collects participant responses and confidence ratings, manages state with Redux, and sends data to REDCap via AWS Lambda.
- Clone the repository and navigate into the project folder.
- Install dependencies:
npm install
- Start the app locally to test:
The app will be available at
npm start
http://localhost:3000.
- Block files:
Each block (Trial_TT_1.js,Trial_TT_2.js,Trial_TT_3.js, etc.) passes two key props to the central `` component:blockIdx: The block number (e.g.,1,2,3, etc.).constantCrossColor: (Only for blocks 1 & 2) The constant color to use for the fixation cross.
<Trial
decibels={this.state.decibels}
shouldRecordRatings={true}
trialCompleteRenderer={this.trialCompleteRenderer}
dataHandler={this.dataHandler}
blockIdx={TRIAL_NUM}
constantCrossColor="default" // or "gray", "black", etc.
/><Trial
decibels={this.state.decibels}
shouldRecordRatings={true}
trialCompleteRenderer={this.trialCompleteRenderer}
dataHandler={this.dataHandler}
blockIdx={TRIAL_NUM}
// No constantCrossColor prop
/>- Trial Component Logic:
- If
constantCrossColoris provided, all miniblocks in that block use the specified color. - Otherwise, the color order for each block is randomly shuffled once and fixed for the duration of the block.
- If
-
Edit the
Trial.jsConstructor:- To change color logic, update how
this.crossColorOrderis set:- Use a constant color when
constantCrossColoris passed. - Otherwise, randomize the order using
blockIdx.
- Use a constant color when
- To change color logic, update how
-
Pass the Correct Props from Block Files:
- For constant-color blocks (1 & 2), pass both
blockIdxandconstantCrossColor. - For randomized-color blocks (3–5), pass only
blockIdx.
- For constant-color blocks (1 & 2), pass both
-
Update the
render()Method inTrial.js:- Ensure the current color is passed to
VisualStimulusascrossColor={this.crossColorOrder[this.state.index % 3]}.
- Ensure the current color is passed to
-
(Optional) Change Color Options:
- Edit the
FIX_CROSS_COLORSarray inTrial.jsto use different colors if needed.
- Edit the
| Block Type | What to Pass to `` | What Happens |
|---|---|---|
| Constant color | blockIdx, constantCrossColor |
Blocks 1-2 |
| Randomized color | blockIdx only |
Random order, fixed for each of three mini-blocks within Blocks 3-5 |
Trial.js: Central logic for trial presentation, including fixation cross color assignment.Trial_TT_1.jstoTrial_TT_5.js: Block-specific components, each passing the appropriate props toTrial.VisualStimulus.js: Receives thecrossColorprop and renders the fixation cross accordingly[1].
- Start the app as described above.
- Verify fixation cross color logic:
- Blocks 1 & 2 should always show the same cross color.
- Blocks 3–5 should each have their own unique, randomized color order for the fixation cross, consistent within each mini-block.
- Redux is used for state management.
- Data is sent to REDCap via AWS Lambda functions.
- See
store.jsand related Redux files for details.
For instructions on deployment, see the lab documentation.
- When adding new blocks or changing color logic, ensure you update both the block file and, if necessary, the color array in
Trial.js.
For more technical details, see the in-code documentation and comments.
If you have questions, contact alexandria.bond@yale.edu.