···11+import * as path from 'path';
22+import { EVENTS } from '../../../constants/constants';
33+44+// Default directories containing stimuli
55+const rootFolder = __dirname; // Note: there's a weird issue where the fs readdir function reads from BrainWaves dir
66+77+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+1111+export const buildCustomTimeline = () => ({
1212+ overview_title: `Custom Experiment`,
1313+ overview: `When you scroll through your social media feed, you may find that you are more likely to pause when a picture
1414+ contains a face, than, for example, a tree.
1515+ In this experiment, you will explore whether our brains process faces differently than other objects (in this case, houses).`,
1616+ background_first_column: `Did you know that we spend more time looking at faces than any other type of stimuli?
1717+ Faces contain a lot of information that is relevant to our day-to-day lives.
1818+ For example, by looking at someone’s face we can assess their emotional state.
1919+ This has led researchers speculate that faces may be processed differently than other stimuli.`,
2020+ background_first_column_question: `In fact, there is a special area in your brain, the Fusiform Face Area, that has been shown to be selective for faces.
2121+ People who have damage in this area may have a hard time recognizing faces, a condition called face blindness, or prosopagnosia.`,
2222+ background_second_column: `In the video (Link 1) the famous neurologist Oliver Sacks explains what it is like to have face blindness to the extent
2323+ that he sometimes didn’t even recognize his own face (!)`,
2424+ background_second_column_question: `Fun fact: Brad Pitt claims he has face blindness, but he has not been tested.
2525+ Do you know anyone who has face blindness?`,
2626+ protocol_title: `What participants are shown`,
2727+ protocol: `In the Faces/Houses experiment, you will see pictures of different faces and houses.`,
2828+ protocol_condition_first_img: `conditionFace`,
2929+ protocol_condition_first_title: `Faces`,
3030+ protocol_condition_first: `When you see a face, press the key “1”.`,
3131+ protocol_condition_second_img: `conditionHouse`,
3232+ protocol_condition_second_title: `Houses`,
3333+ protocol_condition_second: `If you see a house, press “9”.`,
3434+ overview_links: [],
3535+ background_links: [{name: 'Link 1', address: 'https://www.cnn.com/videos/health/2011/01/04/sacks.face.blindness.cnn'}],
3636+ protocal_links: [],
3737+ params: {
3838+ randomize: 'random',
3939+ includePractice: true,
4040+ trialDuration: 1000,
4141+ nbTrials: 8,
4242+ nbPracticeTrials: 2,
4343+ iti: 500,
4444+ presentationTime: 1000,
4545+ selfPaced: true,
4646+ jitter: 200,
4747+ sampleType: 'with-replacement',
4848+ pluginName: 'callback-image-display',
4949+ intro: '',
5050+ taskHelp: '',
5151+ showProgressBar: false,
5252+ stimulus1: {
5353+ dir: '',
5454+ title: 'Condition 1',
5555+ type: EVENTS.STIMULUS_1,
5656+ response: ''
5757+ },
5858+ stimulus2: {
5959+ dir: '',
6060+ title: 'Condition 2',
6161+ type: EVENTS.STIMULUS_2,
6262+ response: ''
6363+ },
6464+ stimulus3: {
6565+ dir: '',
6666+ title: '',
6767+ type: 3,
6868+ response: ''
6969+ },
7070+ stimulus4: {
7171+ dir: '',
7272+ title: '',
7373+ type: 4,
7474+ response: ''
7575+ },
7676+ stimuli: [],
7777+ },
7878+ mainTimeline: ['intro', 'faceHouseTimeline', 'end'], // array of trial and timeline ids
7979+ trials: {
8080+ intro: {
8181+ type: 'callback-html-display',
8282+ id: 'intro',
8383+ post_trial_gap: 1000
8484+ },
8585+ end: {
8686+ id: 'end',
8787+ type: 'callback-html-display',
8888+ stimulus: 'Thanks for participating. Press any key to continue',
8989+ response_ends_trial: true,
9090+ post_trial_gap: 500
9191+ }
9292+ },
9393+ timelines: {
9494+ faceHouseTimeline: {
9595+ id: 'faceHouseTimeline',
9696+ timeline: [
9797+ {
9898+ id: 'interTrial',
9999+ type: 'callback-image-display',
100100+ stimulus: fixation,
101101+ response_ends_trial: false
102102+ },
103103+ {
104104+ id: 'trial',
105105+ response_ends_trial: false
106106+ }
107107+ ]
108108+ }
109109+ }
110110+});
···11// These values must be filled with the appropriate Emotiv credentials to be able to use the Cortex SDK
22// We have our credentials stored in environement variables
3344-var USERNAME = process.env.EMOTIV_USERNAME;
55-var PASSWORD = process.env.EMOTIV_PASSWORD;
66-var CLIENT_ID = process.env.EMOTIV_CLIENT_ID; // Created through Cortex Apps page on Emotiv.com
77-var CLIENT_SECRET = process.env.EMOTIV_CLIENT_SECRET; // Created through Cortex Apps page on Emotiv.com
88-var LICENSE_ID = process.env.EMOTIV_LICENSE_ID; // Visible on My Account page of Emotiv.com
44+const USERNAME = process.env.EMOTIV_USERNAME;
55+const PASSWORD = process.env.EMOTIV_PASSWORD;
66+const CLIENT_ID = process.env.EMOTIV_CLIENT_ID; // Created through Cortex Apps page on Emotiv.com
77+const CLIENT_SECRET = process.env.EMOTIV_CLIENT_SECRET; // Created through Cortex Apps page on Emotiv.com
88+const LICENSE_ID = process.env.EMOTIV_LICENSE_ID; // Visible on My Account page of Emotiv.com
991010module.exports = { USERNAME, PASSWORD, CLIENT_ID, CLIENT_SECRET, LICENSE_ID };