Skip to content

Commit 814f486

Browse files
committed
fixed missing parenthesis in teons elegant faceshouse stimulus refactor
1 parent 5ad82f8 commit 814f486

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

app/utils/labjs/protocols/faceshouses.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ const facesDir = path.join(rootFolder, 'assets', 'face_house', 'faces');
88
const housesDir = path.join(rootFolder, 'assets', 'face_house', 'houses');
99
const fixation = path.join(rootFolder, 'assets', 'common', 'fixationcross.png');
1010

11-
const stimuli = Array.from({length:30}, (v,k) => `Face${k+1}`).concat(Array.from({length:30}, (v,k) => `House${k+1}`).map((s) => ({;
12-
condition: s.startsWith('Face') ? 'Face' : 'House',
13-
dir: s.startsWith('Face') ? facesDir : housesDir,
14-
filename: `${s}.jpg`,
15-
name: s,
16-
response: s.startsWith('Face') ? '1' : '9',
17-
phase: 'main',
18-
type: s.startsWith('Face') ? EVENTS.STIMULUS_1 : EVENTS.STIMULUS_2,
19-
}));
11+
const stimuli = Array.from({ length: 30 }, (_, i) => `Face${i + 1}`)
12+
.concat(Array.from({ length: 30 }, (v, k) => `House${k + 1}`))
13+
.map((s) => ({
14+
condition: s.startsWith('Face') ? 'Face' : 'House',
15+
dir: s.startsWith('Face') ? facesDir : housesDir,
16+
filename: `${s}.jpg`,
17+
name: s,
18+
response: s.startsWith('Face') ? '1' : '9',
19+
phase: 'main',
20+
type: s.startsWith('Face') ? EVENTS.STIMULUS_1 : EVENTS.STIMULUS_2,
21+
}));
2022

2123
// phase: ['Face1', 'House1'].includes(s) ? 'practice' : 'main',
2224

0 commit comments

Comments
 (0)