Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <usermanual>
- AUTOMATIC BALLOON ANALOGUE RISK TASK (autoBART)
- SCRIPT INFO
- This script is based in large part on the BART.iqx script provided by Millisecond Software LLC
- last updated: 08-15-2016 by K. Borchert ([email protected]) for Millisecond Software, LLC
- Copyright © 08-15-2016 Millisecond Software
- BACKGROUND INFO
- *Purpose*
- This script implements the automatic BART as described in:
- Pleskac, T.J., Wallsten, T.S, Wang, P. & Lejuez, C.W. (2008). Development of an Automatic Response Mode to Improve
- the Clinical Utility of Sequential Risk-Taking Tasks. Experimental and Clinical Psychopharmacology, 16, 555–564.
- Note: the autoBART differs from the BART in the following ways
- (1) participants indicate up front how many times they want to pump up the balloon
- (2) default instructions tell participants about the ideal settings
- (3) by default participants are told the explosionpoints for balloons that did not pop (setting can be edited)
- (4) script can be run with a prefixed sequence of explosionpoints or with randomly determined
- explosion points for each balloon (editable values)
- *Task*
- Participants are given 30 (default) balloons and are asked up front to indicate how often they want to pump up each balloon.
- For each successful pump, they can earn money. However, if a balloon pops before the indicated number of pumps
- is reached, participants lose all their potential winnings for the current balloon.
- DATA FILE INFORMATION:
- The default data stored in the data files are:
- (1) Raw data file: 'autoBART_raw*.iqdat' (a separate file for each participant)
- build: Inquisit build
- computer.platform: the platform the script was run on
- date, time, subject: date and time script was run with the current subjectnumber
- fixed_explosionsequence: true = runs the same explosion point sequence for all participants (default)
- false = explosion point is randomly determined for each balloon
- blockcode, blocknum: the name and number of the current block
- trialcode, trialnum: the name and number of the currently recorded trial
- (!!!Note: not all trials that are run might record data:
- by default: only trial.summary record the necessary data to the data file.
- to change: go to TRIALS and check for each trial whether /recorddata = true or false)
- ballooncount: running total of number of balloons
- totalearnings: sums up the earnings across balloons
- explosionpoint: the number of pumps after which the current balloon pops/would have popped
- Note: if parameters.fixed_explosionsequence = false and balloon did not pop:
- values.explosionpoint is randomly determined afterwards
- explosion: 0 = balloon did not explode
- 1 = balloon exploded
- wantedpumps: number of times participant WANTS to pump up a balloon (resets for each balloon)
- pumpcount: number of times a balloon actually gets pumped up (resets for each balloon)
- pumpresult: the selected digit from list.pumpresult (only relevant if parameters.fixed_explosionsequence = false)
- Note: if 1 -> balloon pops
- timebefore1stpump : time it takes participant to decide on wanted number of pumps for each balloon
- response: the participant's response
- Note: only openended.pumpinput could collect response data
- latency: the response latency
- Note: see values.timebefore1stpump
- (2) Summary data file: 'autoBART_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)
- totalearnings: sums up the earnings across balloons
- fixed_explosionsequence: true = runs the same explosion point sequence for all participants (default)
- false = explosion point is randomly determined for each balloon
- ballooncount: running total of number of balloons
- total_explosions : the number of exploded balloons
- nonexplodedballoons : the number of balloons out of (default) 30 that did NOT explode
- total_wantedpumps: number of wanted pumps across all balloons (whether or not it came to it)
- average_wantedpumps: the mean pump count that participant wanted to pump up each balloon (includes exploded balloons)
- STD_wantedpumps: estimated Standard Deviation of wanted pumps
- totalpumpcount: total number of actual pumps across balloons
- averagepumpcount: the mean number of actual pumps per balloon (includes exploded balloons)
- STD_pumpcount: estimated Standard Deviation of actual pumps (across all balloons, exploded and not)
- adjustedtotalpumpcount: sums up the actual pumps of balloons that did not explode (= the number of pumps that participant indicated for non-exploded balloons)
- adjustedaveragepumpcount: mean number of pumps only of balloons that did not explode (= the number of pumps that participant on average indicated for non-exploded balloons) (=Dependent Variable)
- STD_adjustedpumpcount: estimated Standard Deviation of actual pumps of non-exploded balloons
- as well as respective summary statistics (no STDs) separated for the first 10 trials, the second 10 trials and the last 10 trials
- EXPERIMENTAL SET-UP
- * 30 ballons to pump up (default)
- * participants indicate up front how many times the balloon should be pumped up
- * each (successful) pump increases the possible reward gained from this balloon
- * the probability of popping is by default 1/128; explosionpoints are either fixed (parameters.fixed_explosionsequence = true) or
- random (parameters.fixed_explosionsequence = false)
- => If explosion points are random, they get determined by runtime by the same algorithm used for the BART.iqx:
- script samples randomly without replacement from a list of numbers 1-128: once the 1 gets sampled, the balloon pops.
- The probability that the 1 gets sampled increases with each successful pump (-> list.pumpresult).
- => If explosion points are fixed, the original BARTY (youth BART, Lejuez et al, 2007) sequence
- is used in this script (-> list.fixed_explosionpoints)
- * after 30 balloons have been pumped, the experiment is over, and participants are given their final winnings
- * script collects several measures that track the responses to the first 10, the second 10, and the third 10 balloons separately
- INSTRUCTIONS
- Instructions are not original but are based in part on Pleskac et al (2008).
- Instructions can be easily edited under section Editable Instructions
- EDITABLE CODE:
- check under EDITABLE CODE below for (relatively) easily editable parameters, 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 parameters you can change are:
- / totalballoons: Number of balloons: Default is 30
- Note: this script includes summary variables that distinguish between the first 10, the second 10, and the third 10 balloons.
- / pumpvalue: Payoff per pump: Default is $.05
- / balloonsizeincrement: Ballon size increment in pixels (default: 8pixels)
- / showpumpcount: Show current pump count
- true: pump count is shown to participant (default)
- false: pump count is not shown to participant
- / showballooncount: Show current balloon count:
- true: ballon count is shown to participant (default)
- false: ballon count is not shown to participant
- / showpotentialearnings: Show potential earnings for the current balloon (default)
- / revealexplosionpoint: true = reveals explosionpoints of non-popped balloons (default)
- false = does not reveal explosionpoints of of non-popped balloons
- / fixed_explosionsequence: true = runs the same explosion point sequence for all participants (default)
- false = explosion point is randomly determined for each balloon
- Durations:
- / pumpduration: the time it takes for one pump in ms (default: 50ms)
- / revealduration: the time the explosion point of a non-popped balloon is presented at the end of the sequence
- </usermanual>
- **************************************************************************************************************
- **************************************************************************************************************
- EDITABLE PARAMETERS: change editable parameters here
- **************************************************************************************************************
- **************************************************************************************************************
- <parameters>
- / totalballoons = 30
- / pumpvalue = .05
- / balloonsizeincrement = 8
- / showpumpcount = true
- / showballooncount = true
- / showpotentialearnings = false
- / revealexplosionpoint = true
- / fixed_explosionsequence = true
- / pumpduration = 10
- / revealduration = 1000
- </parameters>
- **************************************************************************************************************
- **************************************************************************************************************
- EDITABLE INSTRUCTIONS: change instructions here
- **************************************************************************************************************
- **************************************************************************************************************
- <item instructions>
- / 1 = "Now you're going to see <%parameters.totalballoons%> balloons, one after another, on the screen.
- Each balloon will be pumped up and will eventually pop when it reaches its explosion point. Some of these balloons might pop after just one pump. Others might not pop until they fill the whole screen.
- For each balloon, you will be asked how many times you want to pump up the balloon.
- If a balloon pops before it can be pumped up as many times as you indicated, you lose the point for the balloon."
- / 2 = "The explosion point varies across balloons, ranging from the first pump to the 128th pump.
- The ideal number of pumps is 64. What that means is that if you were to make the same number of pumps on every balloon, your best strategy would be to make 64 pumps for every balloon.
- This would give you the most money over a long period of time.
- However, the actual number of pumps for any particular balloon will vary, so the best overall strategy may not be the best strategy for any one balloon."
- / 2 = "Summary
- * You write the number of times you want to pump up each balloon in a provided textbox.
- * Remember: each balloon can be pumped up 128 times (but if it had not popped after 127 times, it will surely pop after 128)
- * Each balloon is then pumped up until a) that number is reached or b) it pops. Whatever occurs first.
- * the ideal number of pumps is 64. However, the the best overall strategy may not be the best strategy for any one balloon.
- * There are just <%parameters.totalballoons%> balloons.
- Now, do you have any questions?
- Continue if you are ready to start."
- / 3 = "Congratulations!
- This task is now complete."
- </item>
- <item pumpinstructions>
- / 1 = "Enter how many times you want to pump up this balloon"
- / 2 = "Remember: anything higher than 127 and the balloon SURELY pops"
- </item>
- **************************************************************************************************************
- **************************************************************************************************************
- EDITABLE LISTS: change editable lists here
- **************************************************************************************************************
- **************************************************************************************************************
- Note: original explosionpoint sequence used for the BARTY; meets the following criteria:
- 1. first 15 explosion points have Mean = 64 pumps (rounded)
- 2. last 15 explosion points have Mean = 64 pumps (rounded)
- => This list is used if parameters.fixed_explosionsequence is set to TRUE (editable value)
- <list fixed_explosionpoints>
- / items = (64,105,39,96,88,21,121,10,64,32,64,101,26,34,47,121,64,95,75,13,64,112,30,88,9,64,91,17,115,50)
- / selectionmode = sequence
- </list>
- **************************************************************************************************************
- !!!REMAINING CODE: Customize after careful consideration only!!!
- **************************************************************************************************************
- **************************************************************************************************************
- **************************************************************************************************************
- DEFAULTS
- **************************************************************************************************************
- **************************************************************************************************************
- script requires Inquisit 5.0.0.0 or higher
- <defaults>
- / inputdevice = mouse
- / canvasaspectratio = (4,3)
- / minimumversion = "5.0.0.0"
- / fontstyle = ("Arial", 3.52%, false, false, false, false, 5, 1)
- / txbgcolor = white
- / txcolor = black
- </defaults>
- *******************************************************************************************************************
- *******************************************************************************************************************
- DATA: this section contains data file information
- *******************************************************************************************************************
- *******************************************************************************************************************
- ********************
- raw data
- ********************
- <data>
- / columns = (build, computer.platform, date, time, subject, parameters.fixed_explosionsequence, blockcode, blocknum, trialnum, trialcode,
- values.ballooncount, values.totalearnings, values.explosionpoint, values.explosion,
- values.wantedpumps, values.pumpcount, values.pumpresult, values.timebefore1stpump, response, latency)
- / separatefiles = true
- </data>
- ********************
- summary data
- ********************
- <summarydata>
- / separatefiles = true
- / columns = (script.startdate, script.starttime, script.subjectid, script.elapsedtime, computer.platform, values.completed,
- parameters.fixed_explosionsequence, values.totalearnings,
- values.ballooncount, values.total_explosions, values.nonexplodedballoons,
- values.total_wantedpumps, values.average_wantedpumps, expressions.std_wantedpumps,
- values.totalpumpcount, values.averagepumpcount, expressions.std_pumpcount,
- values.adjustedtotalpumpcount, values.adjustedaveragepumpcount, expressions.std_adjustedpumpcount,
- values.ballooncount_10, values.ballooncount_20, values.ballooncount_30,
- values.total_explosions_10, values.total_explosions_20, values.total_explosions_30,
- values.nonexplodedballoons_10, values.nonexplodedballoons_20, values.nonexplodedballoons_30
- values.total_wantedpumps_10, values.total_wantedpumps_20, values.total_wantedpumps_30,
- values.average_wantedpumps_10, values.average_wantedpumps_20, values.average_wantedpumps_30,
- values.totalpumpcount_10, values.totalpumpcount_20, values.totalpumpcount_30,
- values.averagepumpcount_10, values.averagepumpcount_20, values.averagepumpcount_30,
- values.adjustedtotalpumpcount_10, values.adjustedtotalpumpcount_20, values.adjustedtotalpumpcount_30,
- values.adjustedaveragepumpcount_10, values.adjustedaveragepumpcount_20, values.adjustedaveragepumpcount_30)
- </summarydata>
- *******************************************************************************************************************
- *******************************************************************************************************************
- VALUES: automatically updated
- *******************************************************************************************************************
- *******************************************************************************************************************
- completed: 0 = script was not completed; 1 = script was completed (all conditions run)
- balloonheight/balloonwidth: keeps track of balloon size
- pumpresult: the selected digit from list.pumpresult (only relevant if parameters.fixed_explosionsequence = false)
- totalearnings: sums up the earnings across balloons
- explosionpoint: the number of pumps after which the current balloon pops/would have popped
- Note: if parameters.fixed_explosionsequence = false and balloon did not pop:
- values.explosionpoint is randomly determined afterwards
- explosion: 0 = non-exploding balloon
- 1 = exploded balloon
- ballooncount: running total of number of balloons
- ->ballooncount_10 etc ->separate measures for the first 10, the second 10, and the last 10 balloons
- wantedpumps: number of times participant WANTS to pump up a balloon (resets for each balloon)
- total_wantedpumps: number of wanted pumps across all balloons (whether or not it came to it)
- -> total_nr_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
- average_wantedpumps: the mean pump count that participant wanted to pump up each balloon (includes exploded balloons)
- -> average_wantedpumps_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
- SS_wantedpumps: sum of the squared wantedpumps across all balloons
- Unadjusted Scores:
- pumpcount: number of times a balloon actually gets pumped up (resets for each balloon)
- totalpumpcount: total number of actual pumps across balloons
- -> totalpumpcount_10: ->separate measures for the first 10, the second 10, and the last 10 balloons
- averagepumpcount: the mean number of actual pumps per balloon (includes exploded balloons)
- -> averagepumpcount_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
- SS_pumpcount: sum of the squared pumpcounts across all balloons
- Adjusted Scores:
- adjustedtotalpumpcount: sums up the actual pumps of balloons that did not explode (= the number of pumps that participant indicated for non-exploded balloons)
- -> adjustedtotalpumpcount_10 etc.: ->separate measures for the first 10, the second 10, and the last 10 balloons
- adjustedaveragepumpcount: mean number of pumps only of balloons that did not explode (= the number of pumps that participant on average indicated for non-exploded balloons) (=Dependent Variable)
- -> adjustedaveragepumpcount_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
- SS_adjustedpumpcount: sum of the squared adjusted pumpcounts across all balloons
- values.nonexplodedballoons : the number of balloons out of (default) 30 that did NOT explode
- ->values.nonexplodedballoons_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
- values.total_explosions : the number of exploded balloons
- -> values.total_explosions_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
- timebefore1stpump : time it takes participant to decide on wanted number of pumps for each balloon
- monkeyresponse: the wanted pumps of the monkey
- <values>
- / completed = 0
- / balloonheight = 0
- / balloonwidth = 0
- / pumpresult = 0
- / totalearnings = 0.0
- / explosionpoint = 0
- / explosion = 0
- / ballooncount = 0
- / ballooncount_10 = 0
- / ballooncount_20 = 0
- / ballooncount_30 = 0
- / wantedpumps = 0
- / total_wantedpumps = 0
- / total_wantedpumps_10 = 0
- / total_wantedpumps_20 = 0
- / total_wantedpumps_30 = 0
- / average_wantedpumps = 0
- / average_wantedpumps_10 = 0
- / average_wantedpumps_20 = 0
- / average_wantedpumps_30 = 0
- / SS_wantedpumps = 0
- / pumpcount = 0
- / totalpumpcount = 0
- / totalpumpcount_10 = 0
- / totalpumpcount_20 = 0
- / totalpumpcount_30 = 0
- / averagepumpcount = 0
- / averagepumpcount_10 = 0
- / averagepumpcount_20 = 0
- / averagepumpcount_30 = 0
- / SS_pumpcount = 0
- / adjustedtotalpumpcount = 0
- / adjustedtotalpumpcount_10 = 0
- / adjustedtotalpumpcount_20 = 0
- / adjustedtotalpumpcount_30 = 0
- / adjustedaveragepumpcount = 0
- / adjustedaveragepumpcount_10 = 0
- / adjustedaveragepumpcount_20 = 0
- / adjustedaveragepumpcount_30 = 0
- / SS_adjustedpumpcount = 0
- / nonexplodedballoons = 0
- / nonexplodedballoons_10 = 0
- / nonexplodedballoons_20 = 0
- / nonexplodedballoons_30 = 0
- / total_explosions = 0
- / total_explosions_10 = 0
- / total_explosions_20 = 0
- / total_explosions_30 = 0
- / timebefore1stpump = 0
- / monkeyresponse = 0
- </values>
- *******************************************************************************************************************
- *******************************************************************************************************************
- EXPRESSIONS
- *******************************************************************************************************************
- *******************************************************************************************************************
- /STD_wantedpumps: estimated Standard Deviation of wanted pumps
- /STD_pumpcount: estimated Standard Deviation of actual pumps (across all balloons, exploded and not)
- /STD_adjustedpumpcount: estimated Standard Deviation of actual pumps of non-exploded balloons
- <expressions>
- / pumpvalue = format("%.2f", parameters.pumpvalue)
- / totalearnings = format("%.2f", values.totalearnings)
- / potentialearnings = format("%.2f", values.pumpcount * parameters.pumpvalue)
- / STD_wantedpumps = sqrt((values.ss_wantedpumps - (parameters.totalballoons * (values.average_wantedpumps * values.average_wantedpumps)))/(parameters.totalballoons - 1))
- / STD_pumpcount = sqrt((values.ss_pumpcount - (parameters.totalballoons * (values.averagepumpcount * values.averagepumpcount)))/(parameters.totalballoons - 1))
- / STD_adjustedpumpcount = if (values.nonexplodedballoons > 0) sqrt((values.ss_adjustedpumpcount - (values.nonexplodedballoons * (values.adjustedaveragepumpcount * values.adjustedaveragepumpcount)))/(values.nonexplodedballoons - 1))
- </expressions>
- ************************************
- general expressions
- ************************************
- /buttoninstruct: adjusts the instruction text depending on device used to run script
- <expressions>
- / buttoninstruct1 = if (computer.touch) {"Touch";} else {"Click";}
- / buttoninstruct2 = if (computer.touch) {"touch";} else {"click";}
- / buttoninstruct3 = if (computer.touch) {"Touching";} else {"Clicking";}
- / buttoninstruct4 = if (computer.touch) {"touching";} else {"clicking";}
- </expressions>
- *******************************************************************************************************************
- *******************************************************************************************************************
- INSTRUCTIONS
- *******************************************************************************************************************
- *******************************************************************************************************************
- <text instructions>
- / items = instructions
- / vjustify = center
- / hjustify = left
- / size = (90%, 85%)
- / fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
- / select = sequence
- / resetinterval = 0
- </text>
- <text continuebutton>
- / items = ("<%expressions.buttoninstruct2%> to continue")
- / fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
- / size = (20%, 5%)
- / position = (80%, 90%)
- / txbgcolor = black
- / txcolor = white
- / vjustify = center
- </text>
- <trial instructions>
- / stimulustimes = [1=instructions, continuebutton]
- / inputdevice = mouse
- / validresponse = (continuebutton)
- / recorddata = false
- </trial>
- *******************************************************************************************************************
- *******************************************************************************************************************
- STIMULI
- *******************************************************************************************************************
- *******************************************************************************************************************
- <picture balloon>
- / items = ("balloon.jpg")
- / position = (33%, 83%)
- / valign = bottom
- / size = (100%, 100%)
- / erase = false
- </picture>
- <picture poppedballoon>
- / items = ("poppedballoon.jpg")
- / position = (33%, 83%)
- / valign = bottom
- / size = (100%, 100%)
- / erase = false
- </picture>
- <text ballooncount>
- / items = ("Balloon number: <%values.ballooncount%> of <%parameters.totalballoons%> ")
- / position = (60%, 70%)
- / valign = bottom
- / halign = left
- / erase = false
- </text>
- <text totalearnings>
- / items = ("Total Winnings: $<%expressions.totalearnings%> ")
- / position = (60%, 82%)
- / valign = bottom
- / halign = left
- / erase = false
- </text>
- <text potentialearnings>
- / items = ("Potential earnings: $<%expressions.potentialearnings%> ")
- / position = (60%, 64%)
- / valign = bottom
- / halign = left
- / erase = false
- </text>
- <sound popsound>
- / items = ("explosion.wav")
- / playthrough = false
- </sound>
- <sound collectsound>
- / items = ("casino.wav")
- / playthrough = false
- </sound>
- <sound inflatesound>
- / items = ("inflate.wav")
- / playthrough = false
- </sound>i
- <text pumpinputinstruct1>
- / items = pumpinstructions
- / select = 1
- / position = (50%, 10%)
- / fontstyle = ("Arial", 5%, false, false, false, false, 5, 0)
- </text>
- <text pumpinputinstruct2>
- / items = pumpinstructions
- / select = 2
- / position = (50%, 15%)
- / fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
- </text>
- <text wantedpumps>
- / items = ("Number of wanted pumps: <%values.wantedpumps%> ")
- / position = (60%, 58%)
- / valign = bottom
- / halign = left
- / erase = false
- </text>
- <text pumpcount>
- / items = ("Number of current pumps: <%values.pumpcount%> ")
- / position = (60%, 76%)
- / valign = bottom
- / halign = left
- / erase = false
- </text>
- <text explosionreveal>
- / items = ("This balloon would have exploded after <%values.explosionpoint%> pumps")
- / position = (50%, 50%)
- </text>
- <shape blank>
- / shape = rectangle
- / color = white
- / size = (100%, 100%)
- / position = (33%, 83%)
- / valign = bottom
- </shape>
- *******************************************************************************************************************
- *******************************************************************************************************************
- LISTS
- *******************************************************************************************************************
- *******************************************************************************************************************
- Note:
- * selects with no replacement a digit from 1 to 128
- * with each selection the likelihood to sample the "1" increases slightly
- * If "1" is sampled -> balloon pops
- <list pumpresult>
- / items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
- 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 127, 128)
- / replace = false
- </list>
- *******************************************************************************************************************
- *******************************************************************************************************************
- TRIALS
- *******************************************************************************************************************
- *******************************************************************************************************************
- Note: trial.init
- - resets relevant variables for each balloon
- - updates ballooncounts
- - calls openended.pumpinput
- <trial init>
- / ontrialbegin = [
- picture.balloon.width = values.balloonwidth;
- picture.balloon.height = values.balloonheight;
- picture.poppedballoon.width = values.balloonwidth;
- picture.poppedballoon.height = values.balloonheight;
- values.pumpcount = 0;
- values.wantedpumps = 0;
- values.explosionpoint = 0;
- list.pumpresult.reset();
- values.explosion = 0;
- ]
- / stimulustimes = [0=blank]
- / response = noresponse
- / ontrialend = [
- if (trial.init.trialcount <= parameters.totalballoons) {
- values.ballooncount += 1;
- if (values.ballooncount < 11) {
- values.ballooncount_10 += 1;
- } else if (values.ballooncount <21) {
- values.ballooncount_20 += 1;
- } else if (values.ballooncount <31) {
- values.ballooncount_30 += 1;
- }
- ;
- }
- ;
- shape.blank.width = values.balloonwidth;
- shape.blank.height = values.balloonheight;
- ]
- / branch = [openended.pumpinput]
- / recorddata = false
- </trial>
- Notes:
- * provides the textbox to collect number of pumps that participant would like to pump the balloon
- * determines the explosionpoint if parameters.fixed_explosionsequence == true
- * updates summary variables
- * calls trial.pump if that number > 0 otherwise calls trial.collect
- <openended pumpinput>
- / mask = integer
- / charlimit = 3
- / range = (0,128)
- / position = (50%, 30%)
- / stimulustimes = [0=balloon, totalearnings, pumpcount, potentialearnings, ballooncount, pumpinputinstruct1, pumpinputinstruct2, wantedpumps]
- / ontrialend = [
- values.wantedpumps = openended.pumpinput.response;
- if (monkey.monkeymode == true)
- values.wantedpumps = list.monkeyresponses.nextvalue;
- if (parameters.fixed_explosionsequence == true)
- values.explosionpoint = list.fixed_explosionpoints.nextvalue;
- values.timebefore1stpump = openended.pumpinput.latency;
- values.total_wantedpumps += values.wantedpumps;
- if (values.ballooncount < 11)
- values.total_wantedpumps_10 += values.wantedpumps
- else if (values.ballooncount <21 )
- values.total_wantedpumps_20 += values.wantedpumps
- else if (values.ballooncount <31 )
- values.total_wantedpumps_30 += values.wantedpumps
- ;
- ]
- / branch = [
- if (values.wantedpumps > 0)
- trial.pump
- else
- trial.collect;
- ]
- / recorddata = false
- </openended>
- Note:
- - pumps up the balloon by increasing the balloons size and playing a pump sound
- - lasts as long as indicated by parameters.pumpduration (editable value)
- - determines if balloon is to pop after a pump
- if yes -> calls trial.pop
- if no -> determines if balloon needs to be pumped further
- if yes -> calls itself again
- if no -> calls trial.collect
- <trial pump>
- / ontrialbegin = [
- if (parameters.fixed_explosionsequence == false)
- values.pumpresult = list.pumpresult.nextvalue;
- picture.balloon.width += parameters.balloonsizeincrement;
- picture.balloon.height += parameters.balloonsizeincrement;
- shape.blank.width = picture.balloon.width;
- shape.blank.height = picture.balloon.height;
- values.pumpcount += 1;
- ]
- / stimulustimes = [1= balloon, totalearnings, pumpcount, potentialearnings, ballooncount, inflatesound, wantedpumps]
- / trialduration = parameters.pumpduration
- / ontrialend = [
- values.totalpumpcount += 1;
- if (values.ballooncount < 11)
- values.totalpumpcount _10 += 1
- else if (values.ballooncount > 10 && values.ballooncount <21 )
- values.totalpumpcount_20 += 1
- else if (values.ballooncount > 20 && values.ballooncount <31 )
- values.totalpumpcount_30 += 1
- ;
- ]
- / branch = [
- if (parameters.fixed_explosionsequence == false && values.pumpresult == 1)
- trial.pop
- else if (parameters.fixed_explosionsequence == true && values.pumpcount == values.explosionpoint)
- trial.pop
- else if (values.pumpcount == values.wantedpumps)
- trial.collect
- else
- trial.pump;
- ]
- / recorddata = false
- </trial>
- Notes:
- - trial explodes the balloon
- - updates number of explosions
- - calls trial.init for another round
- <trial pop>
- / ontrialbegin = [
- values.explosion = 1;
- values.total_explosions += 1;
- if (values.ballooncount < 11)
- values.total_explosions_10 += 1
- else if (values.ballooncount <21 )
- values.total_explosions_20 += 1
- else if (values.ballooncount <31 )
- values.total_explosions_30 += 1
- ;
- picture.poppedballoon.width = picture.balloon.width;
- picture.poppedballoon.height = picture.balloon.height;
- shape.blank.width = picture.balloon.width;
- shape.blank.height = picture.balloon.height;
- ]
- / stimulustimes = [1=popsound, poppedballoon, totalearnings]
- / response = noresponse
- / ontrialend = [
- values.average_wantedpumps = values.total_wantedpumps/values.ballooncount;
- if (values.ballooncount < 11)
- values.average_wantedpumps_10 = values.total_wantedpumps_10/values.ballooncount_10
- else if (values.ballooncount <21 )
- values.average_wantedpumps_20 = values.total_wantedpumps_20/values.ballooncount_20
- else if (values.ballooncount <31 )
- values.average_wantedpumps_30 = values.total_wantedpumps_30/values.ballooncount_30
- ;
- values.ss_wantedpumps += (values.wantedpumps * values.wantedpumps);
- values.averagepumpcount = values.totalpumpcount/values.ballooncount;
- if (values.ballooncount < 11)
- values.averagepumpcount_10 = values.totalpumpcount_10/values.ballooncount_10
- else if (values.ballooncount <21 )
- values.averagepumpcount_20 = values.totalpumpcount_20/values.ballooncount_20
- else if (values.ballooncount <31 )
- values.averagepumpcount_30 = values.totalpumpcount_30/values.ballooncount_30
- ;
- values.ss_pumpcount += (values.pumpcount * values.pumpcount);
- if (parameters.fixed_explosionsequence == false)
- values.explosionpoint = values.pumpcount;
- ]
- / branch = [trial.summary]
- / responseinterrupt = trial
- / recorddata = false
- </trial>
- Note:
- - trial updates the actual winnings and the number of nonexploded balloons
- - if parameters.fixed_explosionsequence == true calls trial.reveal
- - if parameters.fixed_explosionsequence == false calls trial.findexplosionpoint
- <trial collect>
- / ontrialbegin = [
- values.nonexplodedballoons += 1;
- if (values.ballooncount < 11)
- values.nonexplodedballoons_10 += 1
- else if (values.ballooncount <21 )
- values.nonexplodedballoons_20 += 1
- else if (values.ballooncount <31 )
- values.nonexplodedballoons_30 += 1
- ;
- shape.blank.width = picture.balloon.width;
- shape.blank.height = picture.balloon.height;
- values.totalearnings = values.totalearnings + (values.pumpcount * parameters.pumpvalue);
- ]
- / stimulustimes = [1=collectsound, totalearnings]
- / response = noresponse
- / ontrialend = [
- values.average_wantedpumps = values.total_wantedpumps/values.ballooncount;
- if (values.ballooncount < 11)
- values.average_wantedpumps_10 = values.total_wantedpumps_10/values.ballooncount_10
- else if (values.ballooncount > 10 && values.ballooncount <21 )
- values.average_wantedpumps_20 = values.total_wantedpumps_20/values.ballooncount_20
- else if (values.ballooncount > 20 && values.ballooncount <31 )
- values.average_wantedpumps_30 = values.total_wantedpumps_30/values.ballooncount_30
- ;
- values.ss_wantedpumps += (values.wantedpumps * values.wantedpumps);
- values.averagepumpcount = values.totalpumpcount/values.ballooncount;
- if (values.ballooncount < 11)
- values.averagepumpcount_10 = values.totalpumpcount_10/values.ballooncount_10
- else if (values.ballooncount <21 )
- values.averagepumpcount_20 = values.totalpumpcount_20/values.ballooncount_20
- else if (values.ballooncount <31 )
- values.averagepumpcount_30 = values.totalpumpcount_30/values.ballooncount_30
- ;
- values.ss_pumpcount += (values.pumpcount * values.pumpcount);
- values.adjustedtotalpumpcount += values.pumpcount;
- if (values.ballooncount < 11)
- values.adjustedtotalpumpcount_10 += values.pumpcount
- else if (values.ballooncount <21 )
- values.adjustedtotalpumpcount_20 += values.pumpcount
- else if (values.ballooncount <31 )
- values.adjustedtotalpumpcount_30 += values.pumpcount
- ;
- values.adjustedaveragepumpcount = values.adjustedtotalpumpcount / values.nonexplodedballoons;
- if (values.ballooncount < 11)
- values.adjustedaveragepumpcount_10 = values.adjustedtotalpumpcount_10 / values.nonexplodedballoons_10
- else if (values.ballooncount <21 )
- values.adjustedaveragepumpcount_20 = values.adjustedtotalpumpcount_20 / values.nonexplodedballoons_20
- else if (values.ballooncount <31 )
- values.adjustedaveragepumpcount_30 = values.adjustedtotalpumpcount_30 / values.nonexplodedballoons_30
- ;
- values.ss_adjustedpumpcount += (values.pumpcount * values.pumpcount);
- ]
- / branch = [
- if (parameters.fixed_explosionsequence == false) {
- values.explosionpoint = values.pumpcount;
- trial.findexplosionpoint;
- } else {
- if (parameters.revealexplosionpoint == true) {
- trial.reveal;
- } else {
- trial.summary;
- }
- }
- ]
- / responseinterrupt = trial
- / recorddata = false
- </trial>
- Notes:
- - this trial is only run if parameters.fixed_explosionsequence = false (and the balloon did not pop)
- as the explosion point in this case is not known beforehand
- - determines the explosionpoint by sampling from list.pumpresult as long as it takes to sample the 1
- - once the explosionpoint is established, calls trial.reveal if parameters.revealexplosionpoint = true,
- otherwise calls trial.summary
- <trial findexplosionpoint>
- / ontrialbegin = [
- values.explosionpoint += 1;
- values.pumpresult = list.pumpresult.nextvalue;
- ]
- / branch = [
- if (values.pumpresult == 1) {
- if (parameters.revealexplosionpoint == true) {
- trial.reveal;
- } else {
- trial.summary;
- }
- } else {
- trial.findexplosionpoint;
- }
- ]
- / trialduration = 0
- / recorddata = false
- </trial>
- Notes:
- - trial is only run if balloon did not pop
- - reveals the explosion point of the current balloon for a set amount of time parameters.revealduration (editable value)
- - calls trial.init for another round
- <trial reveal>
- / stimulusframes = [1 = clearscreen, explosionreveal]
- / timeout = parameters.revealduration
- / branch = [trial.summary]
- / recorddata = false
- </trial>
- Notes:
- - purpose of this trial is to save all relevant data to the raw data file
- <trial summary>
- / recorddata = true
- / trialduration = 0
- / branch = [trial.init]
- </trial>
- *******************************************************************************************************************
- *******************************************************************************************************************
- BLOCKS
- *******************************************************************************************************************
- *******************************************************************************************************************
- <block BART>
- / onblockbegin = [
- values.balloonwidth = 0.3 * display.width;
- values.balloonheight = 0.3 * display.height;
- ]
- / trials = [1-3=instructions; 4=init; 5=instructions]
- / stop = [trial.init.trialcount > parameters.totalballoons]
- </block>
- <block summary>
- / trials = [1=instructions]
- </block>
- *******************************************************************************************************************
- *******************************************************************************************************************
- EXPERIMENT
- *******************************************************************************************************************
- *******************************************************************************************************************
- <expt BART>
- / onexptbegin = [
- if ( !parameters.showpumpcount )
- text.pumpcount.hposition = 100%;
- if ( !parameters.showballooncount )
- text.ballooncount.hposition = 100%;
- if ( !parameters.showpotentialearnings )
- text.potentialearnings.hposition = 100%;
- ]
- / blocks = [
- 1=BART;
- 2=summary;
- ]
- / onexptend = [values.completed = 1]
- </expt>
- *******************************************************************************************************************
- *******************************************************************************************************************
- Monkey Code: used for debugging purposes with the monkey
- *******************************************************************************************************************
- *******************************************************************************************************************
- <list monkeyresponses>
- / items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
- 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 127)
- / replace = true
- </list>
- *******************************************************************************************************************
- End of File
- *******************************************************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement