Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 106K
|
+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg.
|
|
|
cansu
|
|
Group: Forum Members
Posts: 38,
Visits: 136
|
+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :(
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 106K
|
+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File **************************************************************************************************************
|
|
|
cansu
|
|
Group: Forum Members
Posts: 38,
Visits: 136
|
+x+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** It doesnt work,I still can't send trigger to Biosemiactive2. Can it be a port problem? I use usb serial com6 port,not a LPT1 port :(
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 106K
|
+x+x+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** It doesnt work,I still can't send trigger to Biosemiactive2. Can it be a port problem? I use usb serial com6 port,not a LPT1 port :( It works fine over serial, I've tested it on my system. Different com port number, but that doesn't make a difference. Double-check that you have the correct com port number. What are the settings for the port in the device manager (baud rate, etc.). And, again, because your previous response was unclear, when you send some bytes to your EEG via the serial port monitor, do these register at all?
|
|
|
cansu
|
|
Group: Forum Members
Posts: 38,
Visits: 136
|
+x+x+x+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** It doesnt work,I still can't send trigger to Biosemiactive2. Can it be a port problem? I use usb serial com6 port,not a LPT1 port :( It works fine over serial, I've tested it on my system. Different com port number, but that doesn't make a difference. Double-check that you have the correct com port number. What are the settings for the port in the device manager (baud rate, etc.). And, again, because your previous response was unclear, when you send some bytes to your EEG via the serial port monitor, do these register at all? A task written in Python sends a trigger when it runs on the same device. Port definition written in Python:port = serial.Serial("COM6", baudrate=115200)
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 106K
|
+x+x+x+x+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** It doesnt work,I still can't send trigger to Biosemiactive2. Can it be a port problem? I use usb serial com6 port,not a LPT1 port :( It works fine over serial, I've tested it on my system. Different com port number, but that doesn't make a difference. Double-check that you have the correct com port number. What are the settings for the port in the device manager (baud rate, etc.). And, again, because your previous response was unclear, when you send some bytes to your EEG via the serial port monitor, do these register at all? A task written in Python sends a trigger when it runs on the same device. Port definition written in Python:port = serial.Serial("COM6", baudrate=115200) That's all well and good, but it doesn't answer two if the questions I asked. So, once again: (1) What are the port settings in the device manager? (2) Can you get bytes to register on your EEG via Tools -> Serial Port Monitor?
|
|
|
cansu
|
|
Group: Forum Members
Posts: 38,
Visits: 136
|
+x+x+x+x+x+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** It doesnt work,I still can't send trigger to Biosemiactive2. Can it be a port problem? I use usb serial com6 port,not a LPT1 port :( It works fine over serial, I've tested it on my system. Different com port number, but that doesn't make a difference. Double-check that you have the correct com port number. What are the settings for the port in the device manager (baud rate, etc.). And, again, because your previous response was unclear, when you send some bytes to your EEG via the serial port monitor, do these register at all? A task written in Python sends a trigger when it runs on the same device. Port definition written in Python:port = serial.Serial("COM6", baudrate=115200) That's all well and good, but it doesn't answer two if the questions I asked. So, once again: (1) What are the port settings in the device manager? (2) Can you get bytes to register on your EEG via Tools -> Serial Port Monitor? 1) baudrate:115200 data bits:8 parity:none stop:1 flow control :none 2)yes,ı get bites how can I define port as com6 with settings Also I tried every version of inquisit,ı can send triggers while task is working in inquisit 4,but ı cannot with inquisit 6,how can ıt be possible?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 106K
|
+x+x+x+x+x+x+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** It doesnt work,I still can't send trigger to Biosemiactive2. Can it be a port problem? I use usb serial com6 port,not a LPT1 port :( It works fine over serial, I've tested it on my system. Different com port number, but that doesn't make a difference. Double-check that you have the correct com port number. What are the settings for the port in the device manager (baud rate, etc.). And, again, because your previous response was unclear, when you send some bytes to your EEG via the serial port monitor, do these register at all? A task written in Python sends a trigger when it runs on the same device. Port definition written in Python:port = serial.Serial("COM6", baudrate=115200) That's all well and good, but it doesn't answer two if the questions I asked. So, once again: (1) What are the port settings in the device manager? (2) Can you get bytes to register on your EEG via Tools -> Serial Port Monitor? 1) baudrate:115200 data bits:8 parity:none stop:1 flow control :none 2)yes,ı get bites how can I define port as com6 with settings Also I tried every version of inquisit,ı can send triggers while task is working in inquisit 4,but ı cannot with inquisit 6,how can ıt be possible? > how can I define port as com6 with settings You don't. You look up what the port number is in the device manager. You use that number in your code. You previously stated that it's COM6, so that is what you use. If it's something else, then use that. Other than that, baudrate settings etc. seem fine. No idea why things aren't working under Inquisit 6 (or 7) -- they should.
|
|
|
cansu
|
|
Group: Forum Members
Posts: 38,
Visits: 136
|
+x+x+x+x+x+x+x+x+x+x+x+x+x+xThanks for answeringAs you mentioned,I define com6 as Port : / port = COM6/ subport = data/ items = ("00001111") But ı cant see triggers on EEG record,ı still have that problem, what is te possible problem? You've defined a <port> stimulus. That's step one. Step two is to actually *display* it when you want it to be sent. Where are you doing that? There's nothing in the code you've shown. MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = COM6 / subport = data / items = ("00000001") </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = COM6 / subport = data / items = ("00000011") </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = COM6 / subport = data / items = ("00000000") </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = COM8 / subport = data / items = ("00000111") </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = COM6 / subport = data / items = ("00001111") </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = COM6 / subport = data / items = ("00011111") </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, incentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(shape.nonincentivecue, values.cueduration); trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, nonincentivecueeeg, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = immediate / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** Here is my script. Task runs but doesnt send any triggers to Biosemiactive2 trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); You lower all the bits at the same time you try to raise them. So this can't send anything. Apart from that, use Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. I checked by using Tools -> Serial Port Monitor to see if you can get any signal out to your device at all. It doesnt seem like any problem with it. But ı couldnt understand what do you mean with 'You lower all the bits at the same time you try to raise them. So this can't send anything.' What should ı change with the script? port.eraseeg must not be output at the same time as port.incentivecueeeg. Thanks Dave, I am new in coding and I am unfamiliar to Millisecond language,so sorry about taking your time. Should I delete last two line to revise the script.: trial.incentive.insertstimulustime(shape.incentivecue, values.cueduration); trial.incentive.insertstimulustime(port.incentivecueeeg, values.cueduration); If it is not,can you share me the final revised version of this script? :( Try this: MONETARY INCENTIVE DELAY TASK SCRIPT INFO Script Author: Katja Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Date: 08-28-2015 last updated: 02-09-2018 by K.Borchert ( katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-09-2018 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Monetary Incentive Delay Task as described in: Knutson, B., Westdorp, A., Kaiser, E., & Hommer, D. (2000). FMRI visualization of brain activity during a monetary incentive delay task. Neuroimage, 12(1), 20-27 *Task* Participants are asked to respond to a brief target shape that follows 2 different cues: one an incentive cue (e.g. an orange shape) and the other a nonincentive cue (e.g. a blue shape). Responses to nonincentive targets (aka targets following nonincentive cues) never have an impact on money gained or money lost; nevertheless participants receive verbal feedback whether they were fast enough or not. Responses to incentive targets have different consequences depending on three different reward conditions: Control vs. Reward vs. Punishment. In the Reward condition, participants who respond fast enough to a target that follows an incentive cue get a monetary reward (e.g. $1). If they are not fast enough, no money is won. In the Punishment condition, participants who respond fast enough to a target that follows an incentive cue do not lose any money (e.g. $1). If they fail to respond in time, they lose money (e.g. $1). In the control condition, there is no difference between incentive and nonincentive targets. Participants can neither win any money, nor can they lose any. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'MonetaryIncentiveDelayTask_raw*.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber /order: 'reward->punish' vs. 'punish->reward' blockcode, blocknum: the name and number of the current block /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms (also the response window) stimulusitem: the presented stimuli in order of trial presentation (only static elements) response: the participant's response (here: scancode of response button) correct: the correctness of the response (1 = correct; 0 = incorrect) latency: the response latency (in ms) /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition (2) Summary data file: 'MonetaryIncentiveDelayTask_summary*.iqdat' (a separate file for each participant) script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition EXPERIMENTAL SET-UP 3 conditions: Control vs. Reward vs. Punishment, tested within in a blocked design. All participants start with the Control condition. The assignment to Reward -> Punishment vs. Punishment -> Reward is counterbalanced by groupnumber (odd groupnumbers start with Reward; even groupnumbers start with Punishment) In each condition: - 100 trials - 20 incentive trials - 80 nonincentive trials => The order is randomized with the constraint that incentive trials cannot be presented consecutively - the color for incentive/nonincentive trials is different for each condition Trial Sequence (6000ms): cue (500ms) -> random delay* (4000-4500ms)-> target (variable, duration = 60th percentile RT)** -> Feedback (500ms) -> ITI (variable to round trial sequence duration to ~6s) *Random Delay: is controlled by list.delay under section Editable Lists **Target Durations: in this script, the targetduration is set to the 60th percentile RT as assessed during baseline ~ 60% correct performance Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21) Note: if the 60th percentile > 500ms the script aborts automatically (500ms is the max. possible target duration given all other default trial durations) STIMULI cues/targets: squares (size can be controlled via values.stimsize under section Editable Values) targets: white in all conditions Control: incentive cue: red; nonincentive cue: green Reward: incentive cue: orange; nonincentive cue: blue Punishment: incentive cue: yellow; nonincentive cue: pink INSTRUCTIONS are not original to Knutson et al (2000) - they can be edited under section Editable Instructions EDITABLE CODE: check below for (relatively) easily editable values, stimuli, instructions etc. Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment. The values you can change are: /responsekey: the scancode of the response key (default: 57 = Spacebar; check Tools-> keyboard scancode for different options) /responsekey_label: the label of the response key (default: Spacebar) /cueduration: the duration of the cue in ms (default: 500) /feedbackduration: the duration of the feedback in ms (default: 500) /trialduration: the duration of a complete trial sequence in ms (default: 6000) /Reward_win: the number of points ($) won in the Reward condition (default: 1) /Punishment_loss: the number of points ($) lost in the Punishment condition (default: 1) /punishment_startamount: the amount of money provided at the beginning of the punishment condition (default: 20) /reward_startamount: the amount of money provided at the beginning of the reward condition (default: 0) /control_startamount: the amount of money provided at the beginning of the control condition (default: 0) /stimsize: the size of the cues/targets as percentages of canvas height (default: 10%) /presenttotal: true = present the "Total earned" throughout Reward and Punishment Blocks. false = does not present the "Total earned" throughout Reward and Punishment Blocks. Note: the expressions under Editable values can be changed to change the 10 targetdurations. </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE values: change editable values here ************************************************************************************************************** ************************************************************************************************************** <values> / responsekey = 57 / responsekey_label = "Spacebar" / cueduration = 500 / feedbackduration = 1500 / trialduration = 7500 / fixediti = 1500 / Reward_win = 1 / Punishment_loss = 1 / punishment_startamount = 40 / reward_startamount = 0 / control_startamount = 0 / stimsize = 10% / presenttotal = true </values> ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** <item feedback> / 1 = "Harika! KAZANDIN." / 2 = "Harika!" / 3 = "Çok yavaş. KAZANAMADIN." / 4 = "Çok yavaş." / 5 = "Harika! KAYBETMEDİN." / 6 = "Çok yavaş. KAYBETTİN." </item> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <instruct> / fontstyle = ("Arial", 5.00%, false, false, false, false, 5, 1) / txcolor = (black) / windowsize = (100%, 100%) </instruct> <page Intro> ^Bu deneyde para kazanmak için, basit bir tepki verme zamanı görevini gerçekleştirmeniz istenecektir. </page> <page baseline> ^İlk olarak, temel olan tepki verme görevini çalışalım: ^^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır. Ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAYINIZ. Hazır olduğunuzda başlayabilirsiniz. </page> <page testStart> ^Temel görevi çalıştığınıza göre şimdi gelecek denemelerle devam edebilirsiniz. ^^Talimatları dikkatlice okuyun. Şimdiki deneme bir öncekinden biraz farklı olacak. </page> <page Control> ^Birazdan gelecek olan denemelerde, BEYAZ bir kare sunulacaktır ve sizden ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, BEYAZ kare sunumu, ya YEŞİL ya da KIRMIZI kare tarafından sinyallenecektir. YEŞİL ya da KIRMIZI kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Control2> ^Testin bu aşamasında, performansınıza bağlı olarak ya para kazanacaksınız ya da para kaybedeceksiniz.Bunu da olası performansınız sonucu karşılacağınız durumlar için bir ön çalışma olarak görebilirsiniz. ^^Bilgisayar başarılı olduğunuzda ya da BEYAZ kareye yanıt vermede çok yavaş olduğunuzda sizi bilgilendirecek. ^^^Deneye başlamak için hazır olduğunuzda başlayabilirsiniz. </page> <page Reward> ^Birazdan gelecek olan denemelerde, tekrar BEYAZ bir kare sunulacaktır ve sizden yine ekrana beyaz kare geldiğinde mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli.Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya TURUNCU ya da MAVİ kare tarafından sinyallenecektir. TURUNCU ya da MAVİ kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Reward2> ^Testin bu aşamasında, TURUNCU karenin sinyallediği BEYAZ kareye yeterince hızlı yanıt verirseniz <%values.reward_win%> TL KAZANACAKSINIZ, FAREYİ TIKLAMAKTA gecikirseniz de total değeriniz değişmeyecek. ^^MAVİ kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. Deneye başlamak için devam edin. </page> <page RewardEnd> ^Deneyin bu kısmında <%values.total_reward%> TL kazandınız. </page> <page Punishment> ^Birazdan gelecek olan denemelerde, BEYAZ kare sunumundan sonra yine mümkün olduğunca hızlı bir şekilde FAREYİ TIKLAMANIZ istenecektir. ^^BEYAZ kare KISA bir süreliğine ekrana geleceğinden mümkün olduğunca hızlı yanıt vermeniz önemli. Ekrandan kaybolduğunda deneme biter. ^^^Size yardımcı olmak adına, bu kez BEYAZ kare sunumu, ya SARI ya da PEMBE kare tarafından sinyallenecektir. SARI ya da PEMBE kare ortadan kaybolduğunda BEYAZ kare kısa bir süreliğine sunulacak ve sizin FAREYİ TIKLAMANIZ gerekecektir. </page> <page Punishment2> ^Testin bu aşamasında, <%values.punishment_startamount%> TL ile başlayıp SARI karenin sinyallediği BEYAZ kareye yanıt vermede yavaş kalırsanız <%values.punishment_loss%> TL kaybetmeye başlarsınız , FAREYİ zamanında TIKLARSANIZ total değeriniz değişmeyecek. ^^PEMBE kareden sonra BEYAZ karenin geldiği denemelerde performansınız totali etkilememektedir fakat tepki süreleriniz de değerlendirildiğinden yine de elinizden gelenin en iyisini yapın. ^^^Deneye başlamak için devam edin </page> <page PunishmentEnd> ^Deneyin bu kısmında <%values.total_punishment%> TL kazandınız. </page> <page End> ^Deneyin sonuna geldiniz. ^^ <%values.total_reward + values.total_punishment%> TL kazandınız. ^^^KATILIMINIZ İÇİN TEŞEKKÜRLER!!! </page> This alert appears on screen if the 40th percentile of baseline reaction times falls below 100ms or above 500ms (max. possible duration) <text alert> / items = ("Yanıt verme süreleri sınırların dışındaydı. Deney sonlandırılacak.") / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) / position = (50%, 50%) / txcolor = white / erase = false </text> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> /buttoninstruct1 = "FARE" </expressions> ************************************************************************************************************** ************************************************************************************************************** EDITABLE LISTS: change editable lists here ************************************************************************************************************** ************************************************************************************************************** <list delay> / items = (4000, 4100, 4200, 4300, 4400, 4500) / replace = true </list> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.0.0 or higher <defaults> / canvasaspectratio = (4,3) / minimumversion = "4.0.0.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / txbgcolor = black / txcolor = (white) / screencolor = black / windowsize = (800px, 600px) </defaults> ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top *********************** raw data file *********************** <data> / separatefiles = true / columns = [build, computer.platform, date, time, subject, group, values.order, blockcode, blocknum, values.exp_condition, trialcode, trialnum, values.incentive_condition, values.delayduration, values.targetduration, expressions.baselineRT60, stimulusitem, response, correct, latency, values.total_control, values.total_reward, values.total_punishment] </data> *********************** summary data file *********************** <summarydata> / columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.order, expressions.meanRT_baseline, expressions.SD_baseline, expressions.baselineRT60, values.total_control, values.total_reward, values.total_punishment, expressions.propCorrect_IncentiveReward, expressions.propCorrect_NonIncentiveReward, expressions.propCorrect_IncentivePunishment, expressions.propCorrect_NonIncentivePunishment, expressions.propCorrect_IncentiveControl, expressions.propCorrect_NonIncentiveControl] / separatefiles = true </summarydata> ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /order: 'reward->punish' vs. 'punish->reward' /exp_condition: 0 = control condition; 1 = Reward condition; 2 = Punishment Condition /incentive_condition: 1 = incentive; 2 = nonincentive /delayduration: the current delay duration in ms /targetduration: the current target duration in ms /total: helper variable that stores the total money for the current block /total_control: the total earned in control condition /total_reward: the total earned in reward condition /total_punishment: the total earned in punishment condition /feedback: stores the itemnumber of the current feedback stimulus /iti: stores the duration of the current iti duration <values> / completed = 0 / order = "" / exp_condition = 1 / incentive_condition = 1 / delayduration = 0 / targetduration = 0 / total = 0 / total_control = 0 / total_reward = 0 / total_punishment = 0 / feedback = 0 / iti = 0 /countcorrect_IncentiveReward = 0 /count_IncentiveReward = 0 /countcorrect_NonIncentiveReward = 0 /count_NonIncentiveReward = 0 /countcorrect_IncentivePunishment = 0 /count_IncentivePunishment = 0 /countcorrect_NonIncentivePunishment = 0 /count_NonIncentivePunishment = 0 /countcorrect_IncentiveControl = 0 /count_IncentiveControl = 0 /countcorrect_NonIncentiveControl = 0 /count_NonIncentiveControl = 0 </values> ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** IMPORTANT NOTE: with the default settings of trialduration = 6000ms cueduration = 500ms max. delay = 4500ms feedback = 500ms the max. targetduration that is possible is 500ms. Knutson et al (2000) report to have used targetdurations beween 160ms and 260ms (p.21)- /meanRT_baseline: determines the baseline mean reaction time in ms /SD_baseline: determines the standard deviation of the baseline reaction times in ms /baselineRT60: determines the 60th percentile reaction time (in ms) based on mean and standard deviation: X = z-score(60th percentile)*SD + (60th percentile = 60% of all reaction times lie below it) /determineDuration: determines the target Duration for a given trial (rounds baselineRT60 to the nearest digit) /propCorrect_IncentiveReward: proportion correct for incentive trials in the reward condition /propCorrect_NonIncentiveReward: proportion correct for nonincentive trials in the reward condition /propCorrect_IncentivePunishment: proportion correct for incentive trials in the punishment condition /propCorrect_NonIncentivePunishment:proportion correct for nonincentive trials in the punishment condition /propCorrect_IncentiveControl: proportion correct for incentive trials in the control condition /propCorrect_NonIncentiveControl: proportion correct for nonincentive trials in the control condition <expressions > / meanRT_baseline = trial.baseline.totalmeanlatency / SD_baseline = trial.baseline.totalsdlatency / baselineRT60 = 0.2533*expressions.SD_baseline + expressions.meanRT_baseline / determineDuration = round(expressions.baselineRT60) / propCorrect_IncentiveReward = values.countcorrect_IncentiveReward/values.count_IncentiveReward / propCorrect_NonIncentiveReward = values.countcorrect_NonIncentiveReward/values.count_NonIncentiveReward / propCorrect_IncentivePunishment = values.countcorrect_IncentivePunishment/values.count_IncentivePunishment / propCorrect_NonIncentivePunishment = values.countcorrect_NonIncentivePunishment/values.count_NonIncentivePunishment / propCorrect_IncentiveControl = values.countcorrect_IncentiveControl/values.count_IncentiveControl / propCorrect_NonIncentiveControl = values.countcorrect_NonIncentiveControl/values.count_NonIncentiveControl </expressions> ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** <shape incentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port incentivecueeeg> / port = com6 / items = (1) / erase = false </port> <shape nonincentivecue> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = red </shape> <port nonincentivecueeeg> / port = com6 / items = (3) / erase = false </port> <shape eraser> / shape = rectangle / size = (values.stimsize * 2 * 0.75, values.stimsize * 2) / position = (50%, 50%) / color = black </shape> <port erasereeg> / port = com6 / items = (0) / erase = false </port> <shape target> / shape = rectangle / size = (values.stimsize * 0.75, values.stimsize) / position = (50%, 50%) / color = white </shape> <port targeteeg> / port = com6 / items = (7) / erase = false </port> <text feedback> / items = feedback / select = values.feedback / vjustify = center / fontstyle = ("Arial", 5%, false, false, false, false, 5, 1) </text> <port feedbackeeg> / port = com6 / items = (15) / erase = false </port> <text total> / items = (" Total = <%values.total%> TL ") / vjustify = center / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) / position = (50%, 90%) / txcolor = gray / erase = false </text> <port totaleeg> / port = com6 / items = (31) / erase = false </port> ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list.baselineRT fills during runtime with all baseline latencies <list baselineRT> </list> Note: the following lists store the success (1) and failures (0) for each experimental condition, separately for incentive/nonincentive trials <list successIncentive_Reward> </list> <list successNonIncentive_Reward> </list> <list successIncentive_Punishment> </list> <list successNonIncentive_Punishment> </list> <list successIncentive_Control> </list> <list successNonIncentive_Control> </list> ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** Note: trial.baseline presents a simple reaction time task * after a variable duration (randomly sampled with replacement), the target appears and participant has to press the responsekey as fast as possible * latencies are stored in list.baselineRT <trial baseline> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) / ontrialbegin = [ values.delayduration = list.delay.nextvalue; trial.baseline.insertstimulustime(shape.target, values.delayduration); ] / beginresponsetime = values.delayduration / ontrialend = [ trial.baseline.resetstimulusframes(); list.baselineRT.insertitem(trial.baseline.latency, 1); ] </trial> <trial baselineAlert> / skip = [ expressions.baselineRT60 < 500 ] / stimulusframes = [1 = alert] / trialduration = 1000 / ontrialend = [ script.abort(); ] </trial> Note: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial incentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,incentivecue, 100) /responsemessage = (rbuttondown,incentivecue, 100) / ontrialbegin = [ values.incentive_condition = 1; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.incentive.insertstimulustime(port.incentivecueeeg, 0); // raise incentive signal trial.incentive.insertstimulustime(shape.eraser, values.cueduration); trial.incentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.incentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.incentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.incentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = incentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.incentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.incentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_IncentiveControl += 1; values.countcorrect_IncentiveControl += trial.incentive.correct; list.successIncentive_Control.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 1) { values.count_IncentiveReward += 1; values.countcorrect_IncentiveReward += trial.incentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_IncentivePunishment += 1; values.countcorrect_IncentivePunishment += trial.incentive.correct; list.successIncentive_Punishment.insertitem(trial.incentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Notes: * trial presents cue (programmed as static stimulus) and target (programmed as dynamic stimulus) * takes in responses at onset of target * times out after response OR after (cueduration+delay+targetduration) whichever comes first * calculates values.iti and calls trial.feedback <trial nonincentive> /inputdevice = mousekey /validresponse = (lbuttondown, rbuttondown) /correctresponse = (lbuttondown, rbuttondown) /responsemessage = (lbuttondown,nonincentivecue, 100) /responsemessage = (rbuttondown,nonincentivecue, 100) / ontrialbegin = [ values.incentive_condition = 2; values.iti=0; values.targetduration = expressions.determineDuration; values.delayduration = list.delay.nextvalue; trial.nonincentive.insertstimulustime(port.nonincentivecueeeg, 0); // raise nonincentive signal trial.nonincentive.insertstimulustime(shape.eraser, values.cueduration); trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration); // lower incentive signal trial.nonincentive.insertstimulustime(shape.target, (values.cueduration + values.delayduration)); trial.nonincentive.insertstimulustime(port.targeteeg, (values.cueduration + values.delayduration)); // raise target signal trial.nonincentive.insertstimulustime(port.erasereeg, values.cueduration + values.delayduration + 40); // lower target signal ] / posttrialpause = values.fixediti / stimulustimes = [0 = nonincentivecue, total] / beginresponsetime = values.cueduration + values.delayduration / responseinterrupt = frames / timeout = values.cueduration + values.delayduration + values.targetduration / ontrialend = [ trial.nonincentive.resetstimulusframes(); values.iti = values.trialduration - values.cueduration - values.delayduration - trial.nonincentive.latency - values.feedbackduration; if (values.exp_condition == 0) { values.count_NonIncentiveControl += 1; values.countcorrect_NonIncentiveControl += trial.nonincentive.correct; list.successNonIncentive_Control.insertitem(trial.nonincentive.correct, 1); } else if (values.exp_condition == 1) { values.count_NonIncentiveReward += 1; values.countcorrect_NonIncentiveReward += trial.nonincentive.correct; list.successIncentive_Reward.insertitem(trial.incentive.correct, 1); } else if (values.exp_condition == 2) { values.count_NonIncentivePunishment += 1; values.countcorrect_NonIncentivePunishment += trial.nonincentive.correct; list.successNonIncentive_Punishment.insertitem(trial.nonincentive.correct, 1); } ; ] / branch = [trial.feedback] </trial> Note: trial.feedback presents the appropriate feedback for a predetermined duration (Note: code that determines the feedback can be found under BLOCKS) IF the current trial was an incentive trial, trial.feedback calls a nonincentive trial next to avoid consecutive incentive trials <trial feedback> / ontrialbegin = [ if (values.feedback == 1 || values.feedback == 2 || values.feedback == 5) { text.feedback.textcolor = green; } else { text.feedback.textcolor = red; }; ] / posttrialpause = values.fixediti / stimulusframes = [1 = feedback,feedbackeeg, total; 3 = erasereeg] / timeout = values.cueduration + values.targetduration / posttrialpause = values.iti / recorddata = false </trial> ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** Note: runs the baseline trials to assess baseline RT <block baseline> / onblockbegin = [ values.exp_condition = "baseline"; values.incentive_condition = 0; ] / preinstructions = (baseline) / postinstructions = (testStart) / trials = [1-5 = baseline; 6 = baselineAlert] </block> Note: block.control/reward/punishment run 100 trials: 20 incentive, 80 nonincentive trials. The order is randomized with the constraint that incentive trials cannot be presented consecutively. To prevent consecutive incentive trials, each incentive trial is followed by a nonincentive trial (this is programmed on the trial level via branch commands) => 20 incentive trials (followed automatically by 20 nonincentive trials) + 60 nonincentive trials => 80 trials called on the block level. The blocks differ in the feedback presented and calculations of total points. <block control> / preinstructions = (Control, Control2) / onblockbegin = [ values.exp_condition = 0; values.total_control = values.control_startamount; values.total = values.total_control; ] / onblockbegin = [ text.total.textcolor = black; shape.incentivecue.color = red; shape.nonincentivecue.color = green; ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 4 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block reward> / preinstructions = (Reward, Reward2) / postinstructions = (RewardEnd) / onblockbegin = [ values.exp_condition = 1; values.total_reward = values.reward_startamount; values.total = values.total_reward ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = orange; shape.nonincentivecue.color = blue ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct && script.currenttrial != "feedback" ) { values.total_reward += values.Reward_win; values.feedback = 1; values.total = values.total_reward }; if (values.incentive_condition == 1 && trial.incentive.error) { values.feedback = 3 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> <block punishment> / preinstructions = (Punishment, Punishment2) / postinstructions = (PunishmentEnd) / onblockbegin = [ values.exp_condition = 2; values.total_punishment = values.punishment_startamount; values.total = values.total_punishment ] / onblockbegin = [ if (values.presenttotal == 1) text.total.textcolor = gray else text.total.textcolor = black; shape.incentivecue.color = yellow; shape.nonincentivecue.color = pink ] / trials = [1-5 = noreplace(incentive, incentive, incentive,incentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive, nonincentive,nonincentive,nonincentive,nonincentive,nonincentive)] / ontrialend = [ if (values.incentive_condition == 1 && trial.incentive.correct) { values.feedback = 5 }; if (values.incentive_condition == 1 && trial.incentive.error && script.currenttrial != "feedback") { values.total_punishment -= values.Punishment_loss; values.total = values.total_punishment; values.feedback = 6 }; if (values.incentive_condition == 2 && trial.nonincentive.correct) { values.feedback = 2 }; if (values.incentive_condition == 2 && trial.nonincentive.error) { values.feedback = 4 } ] </block> ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** Note: order of reward and punishment blocks (after control) counterbalanced by groupnumber odd groupnumbers -> reward, punishment even groupnumbers -> punishment, reward <expt> / subjects = (1 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="reward->punish"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = reward; 4 = punishment; ] </expt> <expt> / subjects = (2 of 2) / groupassignment = groupnumber / preinstructions = (Intro) / postinstructions = (End) / onexptbegin = [values.order="punish->reward"] / onexptend = [values.completed = 1] / blocks = [ 1 = baseline; 2 = control; 3 = punishment; 4 = reward; ] </expt> ************************************************************************************************************** End of File ************************************************************************************************************** It doesnt work,I still can't send trigger to Biosemiactive2. Can it be a port problem? I use usb serial com6 port,not a LPT1 port :( It works fine over serial, I've tested it on my system. Different com port number, but that doesn't make a difference. Double-check that you have the correct com port number. What are the settings for the port in the device manager (baud rate, etc.). And, again, because your previous response was unclear, when you send some bytes to your EEG via the serial port monitor, do these register at all? A task written in Python sends a trigger when it runs on the same device. Port definition written in Python:port = serial.Serial("COM6", baudrate=115200) That's all well and good, but it doesn't answer two if the questions I asked. So, once again: (1) What are the port settings in the device manager? (2) Can you get bytes to register on your EEG via Tools -> Serial Port Monitor? 1) baudrate:115200 data bits:8 parity:none stop:1 flow control :none 2)yes,ı get bites how can I define port as com6 with settings Also I tried every version of inquisit,ı can send triggers while task is working in inquisit 4,but ı cannot with inquisit 6,how can ıt be possible? > how can I define port as com6 with settings You don't. You look up what the port number is in the device manager. You use that number in your code. You previously stated that it's COM6, so that is what you use. If it's something else, then use that. Other than that, baudrate settings etc. seem fine. No idea why things aren't working under Inquisit 6 (or 7) -- they should. Thanks but unfortunately ıt doesn't work with inquisit 6, triggers are sent in inquisit 4 so ı can use ınquisit 4 for my research but ı have no registiration number for it,ı have inquisit 7 license. Please help
|
|
|