Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.25 KB | None | 0 0
  1. <usermanual>
  2.  
  3. AUTOMATIC BALLOON ANALOGUE RISK TASK (autoBART)
  4.  
  5. SCRIPT INFO
  6. This script is based in large part on the BART.iqx script provided by Millisecond Software LLC
  7. last updated: 08-15-2016 by K. Borchert ([email protected]) for Millisecond Software, LLC
  8.  
  9. Copyright © 08-15-2016 Millisecond Software
  10.  
  11.  
  12. BACKGROUND INFO
  13.  
  14. *Purpose*
  15. This script implements the automatic BART as described in:
  16.  
  17. Pleskac, T.J., Wallsten, T.S, Wang, P. & Lejuez, C.W. (2008). Development of an Automatic Response Mode to Improve
  18. the Clinical Utility of Sequential Risk-Taking Tasks. Experimental and Clinical Psychopharmacology, 16, 555–564.
  19.  
  20. Note: the autoBART differs from the BART in the following ways
  21. (1) participants indicate up front how many times they want to pump up the balloon
  22. (2) default instructions tell participants about the ideal settings
  23. (3) by default participants are told the explosionpoints for balloons that did not pop (setting can be edited)
  24. (4) script can be run with a prefixed sequence of explosionpoints or with randomly determined
  25. explosion points for each balloon (editable values)
  26.  
  27.  
  28. *Task*
  29. Participants are given 30 (default) balloons and are asked up front to indicate how often they want to pump up each balloon.
  30. For each successful pump, they can earn money. However, if a balloon pops before the indicated number of pumps
  31. is reached, participants lose all their potential winnings for the current balloon.
  32.  
  33.  
  34. DATA FILE INFORMATION:
  35. The default data stored in the data files are:
  36.  
  37. (1) Raw data file: 'autoBART_raw*.iqdat' (a separate file for each participant)
  38.  
  39. build: Inquisit build
  40. computer.platform: the platform the script was run on
  41. date, time, subject: date and time script was run with the current subjectnumber
  42. fixed_explosionsequence: true = runs the same explosion point sequence for all participants (default)
  43. false = explosion point is randomly determined for each balloon
  44.  
  45. blockcode, blocknum: the name and number of the current block
  46. trialcode, trialnum: the name and number of the currently recorded trial
  47. (!!!Note: not all trials that are run might record data:
  48. by default: only trial.summary record the necessary data to the data file.
  49. to change: go to TRIALS and check for each trial whether /recorddata = true or false)
  50. ballooncount: running total of number of balloons
  51. totalearnings: sums up the earnings across balloons
  52.  
  53. explosionpoint: the number of pumps after which the current balloon pops/would have popped
  54. Note: if parameters.fixed_explosionsequence = false and balloon did not pop:
  55. values.explosionpoint is randomly determined afterwards
  56.  
  57. explosion: 0 = balloon did not explode
  58. 1 = balloon exploded
  59.  
  60. wantedpumps: number of times participant WANTS to pump up a balloon (resets for each balloon)
  61. pumpcount: number of times a balloon actually gets pumped up (resets for each balloon)
  62. pumpresult: the selected digit from list.pumpresult (only relevant if parameters.fixed_explosionsequence = false)
  63. Note: if 1 -> balloon pops
  64. timebefore1stpump : time it takes participant to decide on wanted number of pumps for each balloon
  65.  
  66. response: the participant's response
  67. Note: only openended.pumpinput could collect response data
  68. latency: the response latency
  69. Note: see values.timebefore1stpump
  70.  
  71. (2) Summary data file: 'autoBART_summary*.iqdat' (a separate file for each participant)
  72.  
  73. script.startdate: date script was run
  74. script.starttime: time script was started
  75. script.subjectid: subject id number
  76. script.groupid: group id number
  77. script.elapsedtime: time it took to run script (in ms)
  78. computer.platform: the platform the script was run on
  79. /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run)
  80. totalearnings: sums up the earnings across balloons
  81.  
  82. fixed_explosionsequence: true = runs the same explosion point sequence for all participants (default)
  83. false = explosion point is randomly determined for each balloon
  84.  
  85. ballooncount: running total of number of balloons
  86. total_explosions : the number of exploded balloons
  87. nonexplodedballoons : the number of balloons out of (default) 30 that did NOT explode
  88.  
  89. total_wantedpumps: number of wanted pumps across all balloons (whether or not it came to it)
  90. average_wantedpumps: the mean pump count that participant wanted to pump up each balloon (includes exploded balloons)
  91. STD_wantedpumps: estimated Standard Deviation of wanted pumps
  92.  
  93. totalpumpcount: total number of actual pumps across balloons
  94. averagepumpcount: the mean number of actual pumps per balloon (includes exploded balloons)
  95. STD_pumpcount: estimated Standard Deviation of actual pumps (across all balloons, exploded and not)
  96.  
  97. adjustedtotalpumpcount: sums up the actual pumps of balloons that did not explode (= the number of pumps that participant indicated for non-exploded balloons)
  98. 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)
  99. STD_adjustedpumpcount: estimated Standard Deviation of actual pumps of non-exploded balloons
  100.  
  101. as well as respective summary statistics (no STDs) separated for the first 10 trials, the second 10 trials and the last 10 trials
  102.  
  103.  
  104. EXPERIMENTAL SET-UP
  105. * 30 ballons to pump up (default)
  106. * participants indicate up front how many times the balloon should be pumped up
  107. * each (successful) pump increases the possible reward gained from this balloon
  108. * the probability of popping is by default 1/128; explosionpoints are either fixed (parameters.fixed_explosionsequence = true) or
  109. random (parameters.fixed_explosionsequence = false)
  110. => If explosion points are random, they get determined by runtime by the same algorithm used for the BART.iqx:
  111. script samples randomly without replacement from a list of numbers 1-128: once the 1 gets sampled, the balloon pops.
  112. The probability that the 1 gets sampled increases with each successful pump (-> list.pumpresult).
  113.  
  114. => If explosion points are fixed, the original BARTY (youth BART, Lejuez et al, 2007) sequence
  115. is used in this script (-> list.fixed_explosionpoints)
  116.  
  117. * after 30 balloons have been pumped, the experiment is over, and participants are given their final winnings
  118. * script collects several measures that track the responses to the first 10, the second 10, and the third 10 balloons separately
  119.  
  120. INSTRUCTIONS
  121. Instructions are not original but are based in part on Pleskac et al (2008).
  122. Instructions can be easily edited under section Editable Instructions
  123.  
  124. EDITABLE CODE:
  125. check under EDITABLE CODE below for (relatively) easily editable parameters, stimuli, instructions etc.
  126. 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.
  127.  
  128. The parameters you can change are:
  129.  
  130. / totalballoons: Number of balloons: Default is 30
  131. Note: this script includes summary variables that distinguish between the first 10, the second 10, and the third 10 balloons.
  132.  
  133. / pumpvalue: Payoff per pump: Default is $.05
  134.  
  135. / balloonsizeincrement: Ballon size increment in pixels (default: 8pixels)
  136. / showpumpcount: Show current pump count
  137. true: pump count is shown to participant (default)
  138. false: pump count is not shown to participant
  139.  
  140. / showballooncount: Show current balloon count:
  141. true: ballon count is shown to participant (default)
  142. false: ballon count is not shown to participant
  143.  
  144. / showpotentialearnings: Show potential earnings for the current balloon (default)
  145.  
  146. / revealexplosionpoint: true = reveals explosionpoints of non-popped balloons (default)
  147. false = does not reveal explosionpoints of of non-popped balloons
  148.  
  149. / fixed_explosionsequence: true = runs the same explosion point sequence for all participants (default)
  150. false = explosion point is randomly determined for each balloon
  151.  
  152. Durations:
  153. / pumpduration: the time it takes for one pump in ms (default: 50ms)
  154. / revealduration: the time the explosion point of a non-popped balloon is presented at the end of the sequence
  155.  
  156. </usermanual>
  157.  
  158.  
  159. **************************************************************************************************************
  160. **************************************************************************************************************
  161. EDITABLE PARAMETERS: change editable parameters here
  162. **************************************************************************************************************
  163. **************************************************************************************************************
  164.  
  165. <parameters>
  166. / totalballoons = 30
  167. / pumpvalue = .05
  168. / balloonsizeincrement = 8
  169. / showpumpcount = true
  170. / showballooncount = true
  171. / showpotentialearnings = false
  172. / revealexplosionpoint = true
  173. / fixed_explosionsequence = true
  174. / pumpduration = 10
  175. / revealduration = 1000
  176. </parameters>
  177.  
  178. **************************************************************************************************************
  179. **************************************************************************************************************
  180. EDITABLE INSTRUCTIONS: change instructions here
  181. **************************************************************************************************************
  182. **************************************************************************************************************
  183.  
  184. <item instructions>
  185. / 1 = "Now you're going to see <%parameters.totalballoons%> balloons, one after another, on the screen.
  186.  
  187. 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.
  188.  
  189. For each balloon, you will be asked how many times you want to pump up the balloon.
  190.  
  191. If a balloon pops before it can be pumped up as many times as you indicated, you lose the point for the balloon."
  192.  
  193. / 2 = "The explosion point varies across balloons, ranging from the first pump to the 128th pump.
  194.  
  195. 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.
  196.  
  197. This would give you the most money over a long period of time.
  198.  
  199. 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."
  200. / 2 = "Summary
  201.  
  202. * You write the number of times you want to pump up each balloon in a provided textbox.
  203.  
  204. * Remember: each balloon can be pumped up 128 times (but if it had not popped after 127 times, it will surely pop after 128)
  205.  
  206. * Each balloon is then pumped up until a) that number is reached or b) it pops. Whatever occurs first.
  207.  
  208. * the ideal number of pumps is 64. However, the the best overall strategy may not be the best strategy for any one balloon.
  209.  
  210. * There are just <%parameters.totalballoons%> balloons.
  211.  
  212. Now, do you have any questions?
  213.  
  214. Continue if you are ready to start."
  215. / 3 = "Congratulations!
  216.  
  217. This task is now complete."
  218. </item>
  219.  
  220.  
  221. <item pumpinstructions>
  222. / 1 = "Enter how many times you want to pump up this balloon"
  223. / 2 = "Remember: anything higher than 127 and the balloon SURELY pops"
  224. </item>
  225.  
  226. **************************************************************************************************************
  227. **************************************************************************************************************
  228. EDITABLE LISTS: change editable lists here
  229. **************************************************************************************************************
  230. **************************************************************************************************************
  231.  
  232. Note: original explosionpoint sequence used for the BARTY; meets the following criteria:
  233. 1. first 15 explosion points have Mean = 64 pumps (rounded)
  234. 2. last 15 explosion points have Mean = 64 pumps (rounded)
  235.  
  236. => This list is used if parameters.fixed_explosionsequence is set to TRUE (editable value)
  237.  
  238. <list fixed_explosionpoints>
  239. / 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)
  240. / selectionmode = sequence
  241. </list>
  242.  
  243. **************************************************************************************************************
  244. !!!REMAINING CODE: Customize after careful consideration only!!!
  245. **************************************************************************************************************
  246.  
  247.  
  248. **************************************************************************************************************
  249. **************************************************************************************************************
  250. DEFAULTS
  251. **************************************************************************************************************
  252. **************************************************************************************************************
  253. script requires Inquisit 5.0.0.0 or higher
  254.  
  255. <defaults>
  256. / inputdevice = mouse
  257. / canvasaspectratio = (4,3)
  258. / minimumversion = "5.0.0.0"
  259. / fontstyle = ("Arial", 3.52%, false, false, false, false, 5, 1)
  260. / txbgcolor = white
  261. / txcolor = black
  262. </defaults>
  263.  
  264. *******************************************************************************************************************
  265. *******************************************************************************************************************
  266. DATA: this section contains data file information
  267. *******************************************************************************************************************
  268. *******************************************************************************************************************
  269.  
  270. ********************
  271. raw data
  272. ********************
  273.  
  274. <data>
  275. / columns = (build, computer.platform, date, time, subject, parameters.fixed_explosionsequence, blockcode, blocknum, trialnum, trialcode,
  276. values.ballooncount, values.totalearnings, values.explosionpoint, values.explosion,
  277. values.wantedpumps, values.pumpcount, values.pumpresult, values.timebefore1stpump, response, latency)
  278. / separatefiles = true
  279. </data>
  280.  
  281. ********************
  282. summary data
  283. ********************
  284.  
  285. <summarydata>
  286. / separatefiles = true
  287. / columns = (script.startdate, script.starttime, script.subjectid, script.elapsedtime, computer.platform, values.completed,
  288. parameters.fixed_explosionsequence, values.totalearnings,
  289. values.ballooncount, values.total_explosions, values.nonexplodedballoons,
  290.  
  291. values.total_wantedpumps, values.average_wantedpumps, expressions.std_wantedpumps,
  292. values.totalpumpcount, values.averagepumpcount, expressions.std_pumpcount,
  293. values.adjustedtotalpumpcount, values.adjustedaveragepumpcount, expressions.std_adjustedpumpcount,
  294.  
  295. values.ballooncount_10, values.ballooncount_20, values.ballooncount_30,
  296. values.total_explosions_10, values.total_explosions_20, values.total_explosions_30,
  297. values.nonexplodedballoons_10, values.nonexplodedballoons_20, values.nonexplodedballoons_30
  298.  
  299. values.total_wantedpumps_10, values.total_wantedpumps_20, values.total_wantedpumps_30,
  300. values.average_wantedpumps_10, values.average_wantedpumps_20, values.average_wantedpumps_30,
  301. values.totalpumpcount_10, values.totalpumpcount_20, values.totalpumpcount_30,
  302. values.averagepumpcount_10, values.averagepumpcount_20, values.averagepumpcount_30,
  303. values.adjustedtotalpumpcount_10, values.adjustedtotalpumpcount_20, values.adjustedtotalpumpcount_30,
  304. values.adjustedaveragepumpcount_10, values.adjustedaveragepumpcount_20, values.adjustedaveragepumpcount_30)
  305.  
  306. </summarydata>
  307.  
  308. *******************************************************************************************************************
  309. *******************************************************************************************************************
  310. VALUES: automatically updated
  311. *******************************************************************************************************************
  312. *******************************************************************************************************************
  313. completed: 0 = script was not completed; 1 = script was completed (all conditions run)
  314.  
  315. balloonheight/balloonwidth: keeps track of balloon size
  316.  
  317. pumpresult: the selected digit from list.pumpresult (only relevant if parameters.fixed_explosionsequence = false)
  318.  
  319. totalearnings: sums up the earnings across balloons
  320.  
  321. explosionpoint: the number of pumps after which the current balloon pops/would have popped
  322. Note: if parameters.fixed_explosionsequence = false and balloon did not pop:
  323. values.explosionpoint is randomly determined afterwards
  324.  
  325. explosion: 0 = non-exploding balloon
  326. 1 = exploded balloon
  327.  
  328. ballooncount: running total of number of balloons
  329. ->ballooncount_10 etc ->separate measures for the first 10, the second 10, and the last 10 balloons
  330.  
  331. wantedpumps: number of times participant WANTS to pump up a balloon (resets for each balloon)
  332. total_wantedpumps: number of wanted pumps across all balloons (whether or not it came to it)
  333. -> total_nr_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
  334.  
  335. average_wantedpumps: the mean pump count that participant wanted to pump up each balloon (includes exploded balloons)
  336. -> average_wantedpumps_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
  337.  
  338. SS_wantedpumps: sum of the squared wantedpumps across all balloons
  339.  
  340. Unadjusted Scores:
  341. pumpcount: number of times a balloon actually gets pumped up (resets for each balloon)
  342. totalpumpcount: total number of actual pumps across balloons
  343. -> totalpumpcount_10: ->separate measures for the first 10, the second 10, and the last 10 balloons
  344.  
  345. averagepumpcount: the mean number of actual pumps per balloon (includes exploded balloons)
  346. -> averagepumpcount_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
  347.  
  348. SS_pumpcount: sum of the squared pumpcounts across all balloons
  349.  
  350. Adjusted Scores:
  351. adjustedtotalpumpcount: sums up the actual pumps of balloons that did not explode (= the number of pumps that participant indicated for non-exploded balloons)
  352. -> adjustedtotalpumpcount_10 etc.: ->separate measures for the first 10, the second 10, and the last 10 balloons
  353.  
  354. 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)
  355. -> adjustedaveragepumpcount_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
  356.  
  357. SS_adjustedpumpcount: sum of the squared adjusted pumpcounts across all balloons
  358.  
  359. values.nonexplodedballoons : the number of balloons out of (default) 30 that did NOT explode
  360. ->values.nonexplodedballoons_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
  361.  
  362. values.total_explosions : the number of exploded balloons
  363. -> values.total_explosions_10 etc: ->separate measures for the first 10, the second 10, and the last 10 balloons
  364.  
  365. timebefore1stpump : time it takes participant to decide on wanted number of pumps for each balloon
  366. monkeyresponse: the wanted pumps of the monkey
  367.  
  368. <values>
  369. / completed = 0
  370. / balloonheight = 0
  371. / balloonwidth = 0
  372. / pumpresult = 0
  373. / totalearnings = 0.0
  374. / explosionpoint = 0
  375.  
  376. / explosion = 0
  377.  
  378. / ballooncount = 0
  379. / ballooncount_10 = 0
  380. / ballooncount_20 = 0
  381. / ballooncount_30 = 0
  382.  
  383. / wantedpumps = 0
  384. / total_wantedpumps = 0
  385. / total_wantedpumps_10 = 0
  386. / total_wantedpumps_20 = 0
  387. / total_wantedpumps_30 = 0
  388.  
  389. / average_wantedpumps = 0
  390. / average_wantedpumps_10 = 0
  391. / average_wantedpumps_20 = 0
  392. / average_wantedpumps_30 = 0
  393.  
  394. / SS_wantedpumps = 0
  395.  
  396. / pumpcount = 0
  397. / totalpumpcount = 0
  398. / totalpumpcount_10 = 0
  399. / totalpumpcount_20 = 0
  400. / totalpumpcount_30 = 0
  401.  
  402. / averagepumpcount = 0
  403. / averagepumpcount_10 = 0
  404. / averagepumpcount_20 = 0
  405. / averagepumpcount_30 = 0
  406.  
  407. / SS_pumpcount = 0
  408.  
  409. / adjustedtotalpumpcount = 0
  410. / adjustedtotalpumpcount_10 = 0
  411. / adjustedtotalpumpcount_20 = 0
  412. / adjustedtotalpumpcount_30 = 0
  413.  
  414. / adjustedaveragepumpcount = 0
  415. / adjustedaveragepumpcount_10 = 0
  416. / adjustedaveragepumpcount_20 = 0
  417. / adjustedaveragepumpcount_30 = 0
  418.  
  419. / SS_adjustedpumpcount = 0
  420.  
  421. / nonexplodedballoons = 0
  422. / nonexplodedballoons_10 = 0
  423. / nonexplodedballoons_20 = 0
  424. / nonexplodedballoons_30 = 0
  425.  
  426. / total_explosions = 0
  427. / total_explosions_10 = 0
  428. / total_explosions_20 = 0
  429. / total_explosions_30 = 0
  430.  
  431. / timebefore1stpump = 0
  432.  
  433. / monkeyresponse = 0
  434. </values>
  435.  
  436. *******************************************************************************************************************
  437. *******************************************************************************************************************
  438. EXPRESSIONS
  439. *******************************************************************************************************************
  440. *******************************************************************************************************************
  441.  
  442. /STD_wantedpumps: estimated Standard Deviation of wanted pumps
  443. /STD_pumpcount: estimated Standard Deviation of actual pumps (across all balloons, exploded and not)
  444. /STD_adjustedpumpcount: estimated Standard Deviation of actual pumps of non-exploded balloons
  445.  
  446.  
  447. <expressions>
  448. / pumpvalue = format("%.2f", parameters.pumpvalue)
  449. / totalearnings = format("%.2f", values.totalearnings)
  450. / potentialearnings = format("%.2f", values.pumpcount * parameters.pumpvalue)
  451.  
  452.  
  453. / STD_wantedpumps = sqrt((values.ss_wantedpumps - (parameters.totalballoons * (values.average_wantedpumps * values.average_wantedpumps)))/(parameters.totalballoons - 1))
  454. / STD_pumpcount = sqrt((values.ss_pumpcount - (parameters.totalballoons * (values.averagepumpcount * values.averagepumpcount)))/(parameters.totalballoons - 1))
  455. / STD_adjustedpumpcount = if (values.nonexplodedballoons > 0) sqrt((values.ss_adjustedpumpcount - (values.nonexplodedballoons * (values.adjustedaveragepumpcount * values.adjustedaveragepumpcount)))/(values.nonexplodedballoons - 1))
  456. </expressions>
  457.  
  458. ************************************
  459. general expressions
  460. ************************************
  461. /buttoninstruct: adjusts the instruction text depending on device used to run script
  462.  
  463. <expressions>
  464. / buttoninstruct1 = if (computer.touch) {"Touch";} else {"Click";}
  465. / buttoninstruct2 = if (computer.touch) {"touch";} else {"click";}
  466. / buttoninstruct3 = if (computer.touch) {"Touching";} else {"Clicking";}
  467. / buttoninstruct4 = if (computer.touch) {"touching";} else {"clicking";}
  468. </expressions>
  469.  
  470. *******************************************************************************************************************
  471. *******************************************************************************************************************
  472. INSTRUCTIONS
  473. *******************************************************************************************************************
  474. *******************************************************************************************************************
  475. <text instructions>
  476. / items = instructions
  477. / vjustify = center
  478. / hjustify = left
  479. / size = (90%, 85%)
  480. / fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
  481. / select = sequence
  482. / resetinterval = 0
  483. </text>
  484.  
  485. <text continuebutton>
  486. / items = ("<%expressions.buttoninstruct2%> to continue")
  487. / fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
  488. / size = (20%, 5%)
  489. / position = (80%, 90%)
  490. / txbgcolor = black
  491. / txcolor = white
  492. / vjustify = center
  493. </text>
  494.  
  495. <trial instructions>
  496. / stimulustimes = [1=instructions, continuebutton]
  497. / inputdevice = mouse
  498. / validresponse = (continuebutton)
  499. / recorddata = false
  500. </trial>
  501.  
  502. *******************************************************************************************************************
  503. *******************************************************************************************************************
  504. STIMULI
  505. *******************************************************************************************************************
  506. *******************************************************************************************************************
  507. <picture balloon>
  508. / items = ("balloon.jpg")
  509. / position = (33%, 83%)
  510. / valign = bottom
  511. / size = (100%, 100%)
  512. / erase = false
  513. </picture>
  514.  
  515. <picture poppedballoon>
  516. / items = ("poppedballoon.jpg")
  517. / position = (33%, 83%)
  518. / valign = bottom
  519. / size = (100%, 100%)
  520. / erase = false
  521. </picture>
  522.  
  523. <text ballooncount>
  524. / items = ("Balloon number: <%values.ballooncount%> of <%parameters.totalballoons%> ")
  525. / position = (60%, 70%)
  526. / valign = bottom
  527. / halign = left
  528. / erase = false
  529. </text>
  530.  
  531. <text totalearnings>
  532. / items = ("Total Winnings: $<%expressions.totalearnings%> ")
  533. / position = (60%, 82%)
  534. / valign = bottom
  535. / halign = left
  536. / erase = false
  537. </text>
  538.  
  539. <text potentialearnings>
  540. / items = ("Potential earnings: $<%expressions.potentialearnings%> ")
  541. / position = (60%, 64%)
  542. / valign = bottom
  543. / halign = left
  544. / erase = false
  545. </text>
  546.  
  547. <sound popsound>
  548. / items = ("explosion.wav")
  549. / playthrough = false
  550. </sound>
  551.  
  552. <sound collectsound>
  553. / items = ("casino.wav")
  554. / playthrough = false
  555. </sound>
  556.  
  557. <sound inflatesound>
  558. / items = ("inflate.wav")
  559. / playthrough = false
  560. </sound>i
  561.  
  562. <text pumpinputinstruct1>
  563. / items = pumpinstructions
  564. / select = 1
  565. / position = (50%, 10%)
  566. / fontstyle = ("Arial", 5%, false, false, false, false, 5, 0)
  567. </text>
  568.  
  569. <text pumpinputinstruct2>
  570. / items = pumpinstructions
  571. / select = 2
  572. / position = (50%, 15%)
  573. / fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
  574. </text>
  575.  
  576. <text wantedpumps>
  577. / items = ("Number of wanted pumps: <%values.wantedpumps%> ")
  578. / position = (60%, 58%)
  579. / valign = bottom
  580. / halign = left
  581. / erase = false
  582. </text>
  583.  
  584. <text pumpcount>
  585. / items = ("Number of current pumps: <%values.pumpcount%> ")
  586. / position = (60%, 76%)
  587. / valign = bottom
  588. / halign = left
  589. / erase = false
  590. </text>
  591.  
  592. <text explosionreveal>
  593. / items = ("This balloon would have exploded after <%values.explosionpoint%> pumps")
  594. / position = (50%, 50%)
  595. </text>
  596.  
  597. <shape blank>
  598. / shape = rectangle
  599. / color = white
  600. / size = (100%, 100%)
  601. / position = (33%, 83%)
  602. / valign = bottom
  603. </shape>
  604.  
  605.  
  606.  
  607.  
  608. *******************************************************************************************************************
  609. *******************************************************************************************************************
  610. LISTS
  611. *******************************************************************************************************************
  612. *******************************************************************************************************************
  613. Note:
  614. * selects with no replacement a digit from 1 to 128
  615. * with each selection the likelihood to sample the "1" increases slightly
  616. * If "1" is sampled -> balloon pops
  617.  
  618. <list pumpresult>
  619. / items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
  620. 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
  621. 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
  622. 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
  623. 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
  624. 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
  625. 121, 122, 123, 124, 125, 126, 127, 128)
  626. / replace = false
  627. </list>
  628.  
  629. *******************************************************************************************************************
  630. *******************************************************************************************************************
  631. TRIALS
  632. *******************************************************************************************************************
  633. *******************************************************************************************************************
  634.  
  635. Note: trial.init
  636. - resets relevant variables for each balloon
  637. - updates ballooncounts
  638. - calls openended.pumpinput
  639. <trial init>
  640. / ontrialbegin = [
  641. picture.balloon.width = values.balloonwidth;
  642. picture.balloon.height = values.balloonheight;
  643. picture.poppedballoon.width = values.balloonwidth;
  644. picture.poppedballoon.height = values.balloonheight;
  645. values.pumpcount = 0;
  646. values.wantedpumps = 0;
  647. values.explosionpoint = 0;
  648. list.pumpresult.reset();
  649. values.explosion = 0;
  650. ]
  651. / stimulustimes = [0=blank]
  652. / response = noresponse
  653. / ontrialend = [
  654. if (trial.init.trialcount <= parameters.totalballoons) {
  655. values.ballooncount += 1;
  656. if (values.ballooncount < 11) {
  657. values.ballooncount_10 += 1;
  658. } else if (values.ballooncount <21) {
  659. values.ballooncount_20 += 1;
  660. } else if (values.ballooncount <31) {
  661. values.ballooncount_30 += 1;
  662. }
  663. ;
  664. }
  665. ;
  666. shape.blank.width = values.balloonwidth;
  667. shape.blank.height = values.balloonheight;
  668. ]
  669. / branch = [openended.pumpinput]
  670. / recorddata = false
  671. </trial>
  672.  
  673.  
  674. Notes:
  675. * provides the textbox to collect number of pumps that participant would like to pump the balloon
  676. * determines the explosionpoint if parameters.fixed_explosionsequence == true
  677. * updates summary variables
  678. * calls trial.pump if that number > 0 otherwise calls trial.collect
  679. <openended pumpinput>
  680. / mask = integer
  681. / charlimit = 3
  682. / range = (0,128)
  683. / position = (50%, 30%)
  684. / stimulustimes = [0=balloon, totalearnings, pumpcount, potentialearnings, ballooncount, pumpinputinstruct1, pumpinputinstruct2, wantedpumps]
  685. / ontrialend = [
  686. values.wantedpumps = openended.pumpinput.response;
  687. if (monkey.monkeymode == true)
  688. values.wantedpumps = list.monkeyresponses.nextvalue;
  689. if (parameters.fixed_explosionsequence == true)
  690. values.explosionpoint = list.fixed_explosionpoints.nextvalue;
  691. values.timebefore1stpump = openended.pumpinput.latency;
  692. values.total_wantedpumps += values.wantedpumps;
  693. if (values.ballooncount < 11)
  694. values.total_wantedpumps_10 += values.wantedpumps
  695. else if (values.ballooncount <21 )
  696. values.total_wantedpumps_20 += values.wantedpumps
  697. else if (values.ballooncount <31 )
  698. values.total_wantedpumps_30 += values.wantedpumps
  699. ;
  700. ]
  701. / branch = [
  702. if (values.wantedpumps > 0)
  703. trial.pump
  704. else
  705. trial.collect;
  706. ]
  707. / recorddata = false
  708. </openended>
  709.  
  710.  
  711. Note:
  712. - pumps up the balloon by increasing the balloons size and playing a pump sound
  713. - lasts as long as indicated by parameters.pumpduration (editable value)
  714. - determines if balloon is to pop after a pump
  715. if yes -> calls trial.pop
  716. if no -> determines if balloon needs to be pumped further
  717. if yes -> calls itself again
  718. if no -> calls trial.collect
  719. <trial pump>
  720. / ontrialbegin = [
  721. if (parameters.fixed_explosionsequence == false)
  722. values.pumpresult = list.pumpresult.nextvalue;
  723. picture.balloon.width += parameters.balloonsizeincrement;
  724. picture.balloon.height += parameters.balloonsizeincrement;
  725. shape.blank.width = picture.balloon.width;
  726. shape.blank.height = picture.balloon.height;
  727. values.pumpcount += 1;
  728. ]
  729. / stimulustimes = [1= balloon, totalearnings, pumpcount, potentialearnings, ballooncount, inflatesound, wantedpumps]
  730. / trialduration = parameters.pumpduration
  731. / ontrialend = [
  732. values.totalpumpcount += 1;
  733. if (values.ballooncount < 11)
  734. values.totalpumpcount _10 += 1
  735. else if (values.ballooncount > 10 && values.ballooncount <21 )
  736. values.totalpumpcount_20 += 1
  737. else if (values.ballooncount > 20 && values.ballooncount <31 )
  738. values.totalpumpcount_30 += 1
  739. ;
  740. ]
  741. / branch = [
  742. if (parameters.fixed_explosionsequence == false && values.pumpresult == 1)
  743. trial.pop
  744. else if (parameters.fixed_explosionsequence == true && values.pumpcount == values.explosionpoint)
  745. trial.pop
  746. else if (values.pumpcount == values.wantedpumps)
  747. trial.collect
  748. else
  749. trial.pump;
  750. ]
  751. / recorddata = false
  752. </trial>
  753.  
  754.  
  755. Notes:
  756. - trial explodes the balloon
  757. - updates number of explosions
  758. - calls trial.init for another round
  759.  
  760. <trial pop>
  761. / ontrialbegin = [
  762. values.explosion = 1;
  763. values.total_explosions += 1;
  764. if (values.ballooncount < 11)
  765. values.total_explosions_10 += 1
  766. else if (values.ballooncount <21 )
  767. values.total_explosions_20 += 1
  768. else if (values.ballooncount <31 )
  769. values.total_explosions_30 += 1
  770. ;
  771. picture.poppedballoon.width = picture.balloon.width;
  772. picture.poppedballoon.height = picture.balloon.height;
  773. shape.blank.width = picture.balloon.width;
  774. shape.blank.height = picture.balloon.height;
  775. ]
  776. / stimulustimes = [1=popsound, poppedballoon, totalearnings]
  777. / response = noresponse
  778. / ontrialend = [
  779. values.average_wantedpumps = values.total_wantedpumps/values.ballooncount;
  780. if (values.ballooncount < 11)
  781. values.average_wantedpumps_10 = values.total_wantedpumps_10/values.ballooncount_10
  782. else if (values.ballooncount <21 )
  783. values.average_wantedpumps_20 = values.total_wantedpumps_20/values.ballooncount_20
  784. else if (values.ballooncount <31 )
  785. values.average_wantedpumps_30 = values.total_wantedpumps_30/values.ballooncount_30
  786. ;
  787. values.ss_wantedpumps += (values.wantedpumps * values.wantedpumps);
  788. values.averagepumpcount = values.totalpumpcount/values.ballooncount;
  789. if (values.ballooncount < 11)
  790. values.averagepumpcount_10 = values.totalpumpcount_10/values.ballooncount_10
  791. else if (values.ballooncount <21 )
  792. values.averagepumpcount_20 = values.totalpumpcount_20/values.ballooncount_20
  793. else if (values.ballooncount <31 )
  794. values.averagepumpcount_30 = values.totalpumpcount_30/values.ballooncount_30
  795. ;
  796. values.ss_pumpcount += (values.pumpcount * values.pumpcount);
  797. if (parameters.fixed_explosionsequence == false)
  798. values.explosionpoint = values.pumpcount;
  799. ]
  800. / branch = [trial.summary]
  801. / responseinterrupt = trial
  802. / recorddata = false
  803. </trial>
  804.  
  805.  
  806. Note:
  807. - trial updates the actual winnings and the number of nonexploded balloons
  808. - if parameters.fixed_explosionsequence == true calls trial.reveal
  809. - if parameters.fixed_explosionsequence == false calls trial.findexplosionpoint
  810. <trial collect>
  811. / ontrialbegin = [
  812. values.nonexplodedballoons += 1;
  813. if (values.ballooncount < 11)
  814. values.nonexplodedballoons_10 += 1
  815. else if (values.ballooncount <21 )
  816. values.nonexplodedballoons_20 += 1
  817. else if (values.ballooncount <31 )
  818. values.nonexplodedballoons_30 += 1
  819. ;
  820. shape.blank.width = picture.balloon.width;
  821. shape.blank.height = picture.balloon.height;
  822. values.totalearnings = values.totalearnings + (values.pumpcount * parameters.pumpvalue);
  823. ]
  824. / stimulustimes = [1=collectsound, totalearnings]
  825. / response = noresponse
  826.  
  827. / ontrialend = [
  828. values.average_wantedpumps = values.total_wantedpumps/values.ballooncount;
  829. if (values.ballooncount < 11)
  830. values.average_wantedpumps_10 = values.total_wantedpumps_10/values.ballooncount_10
  831. else if (values.ballooncount > 10 && values.ballooncount <21 )
  832. values.average_wantedpumps_20 = values.total_wantedpumps_20/values.ballooncount_20
  833. else if (values.ballooncount > 20 && values.ballooncount <31 )
  834. values.average_wantedpumps_30 = values.total_wantedpumps_30/values.ballooncount_30
  835. ;
  836. values.ss_wantedpumps += (values.wantedpumps * values.wantedpumps);
  837. values.averagepumpcount = values.totalpumpcount/values.ballooncount;
  838. if (values.ballooncount < 11)
  839. values.averagepumpcount_10 = values.totalpumpcount_10/values.ballooncount_10
  840. else if (values.ballooncount <21 )
  841. values.averagepumpcount_20 = values.totalpumpcount_20/values.ballooncount_20
  842. else if (values.ballooncount <31 )
  843. values.averagepumpcount_30 = values.totalpumpcount_30/values.ballooncount_30
  844. ;
  845. values.ss_pumpcount += (values.pumpcount * values.pumpcount);
  846. values.adjustedtotalpumpcount += values.pumpcount;
  847. if (values.ballooncount < 11)
  848. values.adjustedtotalpumpcount_10 += values.pumpcount
  849. else if (values.ballooncount <21 )
  850. values.adjustedtotalpumpcount_20 += values.pumpcount
  851. else if (values.ballooncount <31 )
  852. values.adjustedtotalpumpcount_30 += values.pumpcount
  853. ;
  854. values.adjustedaveragepumpcount = values.adjustedtotalpumpcount / values.nonexplodedballoons;
  855. if (values.ballooncount < 11)
  856. values.adjustedaveragepumpcount_10 = values.adjustedtotalpumpcount_10 / values.nonexplodedballoons_10
  857. else if (values.ballooncount <21 )
  858. values.adjustedaveragepumpcount_20 = values.adjustedtotalpumpcount_20 / values.nonexplodedballoons_20
  859. else if (values.ballooncount <31 )
  860. values.adjustedaveragepumpcount_30 = values.adjustedtotalpumpcount_30 / values.nonexplodedballoons_30
  861. ;
  862. values.ss_adjustedpumpcount += (values.pumpcount * values.pumpcount);
  863. ]
  864. / branch = [
  865. if (parameters.fixed_explosionsequence == false) {
  866. values.explosionpoint = values.pumpcount;
  867. trial.findexplosionpoint;
  868. } else {
  869. if (parameters.revealexplosionpoint == true) {
  870. trial.reveal;
  871. } else {
  872. trial.summary;
  873. }
  874. }
  875. ]
  876. / responseinterrupt = trial
  877. / recorddata = false
  878. </trial>
  879.  
  880.  
  881. Notes:
  882. - this trial is only run if parameters.fixed_explosionsequence = false (and the balloon did not pop)
  883. as the explosion point in this case is not known beforehand
  884. - determines the explosionpoint by sampling from list.pumpresult as long as it takes to sample the 1
  885. - once the explosionpoint is established, calls trial.reveal if parameters.revealexplosionpoint = true,
  886. otherwise calls trial.summary
  887. <trial findexplosionpoint>
  888. / ontrialbegin = [
  889. values.explosionpoint += 1;
  890. values.pumpresult = list.pumpresult.nextvalue;
  891. ]
  892. / branch = [
  893. if (values.pumpresult == 1) {
  894. if (parameters.revealexplosionpoint == true) {
  895. trial.reveal;
  896. } else {
  897. trial.summary;
  898. }
  899. } else {
  900. trial.findexplosionpoint;
  901. }
  902. ]
  903. / trialduration = 0
  904. / recorddata = false
  905. </trial>
  906.  
  907.  
  908. Notes:
  909. - trial is only run if balloon did not pop
  910. - reveals the explosion point of the current balloon for a set amount of time parameters.revealduration (editable value)
  911. - calls trial.init for another round
  912. <trial reveal>
  913. / stimulusframes = [1 = clearscreen, explosionreveal]
  914. / timeout = parameters.revealduration
  915. / branch = [trial.summary]
  916. / recorddata = false
  917. </trial>
  918.  
  919. Notes:
  920. - purpose of this trial is to save all relevant data to the raw data file
  921. <trial summary>
  922. / recorddata = true
  923. / trialduration = 0
  924. / branch = [trial.init]
  925. </trial>
  926.  
  927. *******************************************************************************************************************
  928. *******************************************************************************************************************
  929. BLOCKS
  930. *******************************************************************************************************************
  931. *******************************************************************************************************************
  932. <block BART>
  933. / onblockbegin = [
  934. values.balloonwidth = 0.3 * display.width;
  935. values.balloonheight = 0.3 * display.height;
  936. ]
  937. / trials = [1-3=instructions; 4=init; 5=instructions]
  938. / stop = [trial.init.trialcount > parameters.totalballoons]
  939. </block>
  940.  
  941. <block summary>
  942. / trials = [1=instructions]
  943. </block>
  944.  
  945.  
  946. *******************************************************************************************************************
  947. *******************************************************************************************************************
  948. EXPERIMENT
  949. *******************************************************************************************************************
  950. *******************************************************************************************************************
  951.  
  952. <expt BART>
  953. / onexptbegin = [
  954. if ( !parameters.showpumpcount )
  955. text.pumpcount.hposition = 100%;
  956. if ( !parameters.showballooncount )
  957. text.ballooncount.hposition = 100%;
  958. if ( !parameters.showpotentialearnings )
  959. text.potentialearnings.hposition = 100%;
  960. ]
  961. / blocks = [
  962. 1=BART;
  963. 2=summary;
  964. ]
  965. / onexptend = [values.completed = 1]
  966. </expt>
  967.  
  968. *******************************************************************************************************************
  969. *******************************************************************************************************************
  970. Monkey Code: used for debugging purposes with the monkey
  971. *******************************************************************************************************************
  972. *******************************************************************************************************************
  973.  
  974. <list monkeyresponses>
  975. / items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
  976. 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
  977. 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
  978. 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
  979. 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
  980. 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
  981. 121, 122, 123, 124, 125, 126, 127)
  982. / replace = true
  983. </list>
  984.  
  985. *******************************************************************************************************************
  986. End of File
  987. *******************************************************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement