Skip to content

Commit

Permalink
fixed missing parenthesis in teons elegant faceshouse stimulus refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpigeon committed Aug 21, 2020
1 parent 5ad82f8 commit 814f486
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions app/utils/labjs/protocols/faceshouses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ const facesDir = path.join(rootFolder, 'assets', 'face_house', 'faces');
const housesDir = path.join(rootFolder, 'assets', 'face_house', 'houses');
const fixation = path.join(rootFolder, 'assets', 'common', 'fixationcross.png');

const stimuli = Array.from({length:30}, (v,k) => `Face${k+1}`).concat(Array.from({length:30}, (v,k) => `House${k+1}`).map((s) => ({;
condition: s.startsWith('Face') ? 'Face' : 'House',
dir: s.startsWith('Face') ? facesDir : housesDir,
filename: `${s}.jpg`,
name: s,
response: s.startsWith('Face') ? '1' : '9',
phase: 'main',
type: s.startsWith('Face') ? EVENTS.STIMULUS_1 : EVENTS.STIMULUS_2,
}));
const stimuli = Array.from({ length: 30 }, (_, i) => `Face${i + 1}`)
.concat(Array.from({ length: 30 }, (v, k) => `House${k + 1}`))
.map((s) => ({
condition: s.startsWith('Face') ? 'Face' : 'House',
dir: s.startsWith('Face') ? facesDir : housesDir,
filename: `${s}.jpg`,
name: s,
response: s.startsWith('Face') ? '1' : '9',
phase: 'main',
type: s.startsWith('Face') ? EVENTS.STIMULUS_1 : EVENTS.STIMULUS_2,
}));

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

Expand Down

0 comments on commit 814f486

Please sign in to comment.