aquirk
|
|
Group: Forum Members
Posts: 31,
Visits: 70
|
I've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+xI've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block> The expression you have here <expressions> ... / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; ... </expression> is nothing like the original expression and will obviously not calculate / return the total time spent on target across trials. Compare to the original: / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration*trial.startRotate.trialcount) - expressions.sum_offDurations_total else parameters.trialDuration * trial.startRotate.trialcount;
|
|
|
aquirk
|
|
Group: Forum Members
Posts: 31,
Visits: 70
|
+x+xI've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block> The expression you have here <expressions> ... / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; ... </expression> is nothing like the original expression and will obviously not calculate / return the total time spent on target across trials. Compare to the original: / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration*trial.startRotate.trialcount) - expressions.sum_offDurations_total else parameters.trialDuration * trial.startRotate.trialcount; But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer exists, instead it's been replaced by six independent test1, test2, ..., test6 trials. Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. Do you have any suggestions as to how I could amend these expressions to collect the data correctly, given my study design?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+xI've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block> The expression you have here <expressions> ... / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; ... </expression> is nothing like the original expression and will obviously not calculate / return the total time spent on target across trials. Compare to the original: / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration*trial.startRotate.trialcount) - expressions.sum_offDurations_total else parameters.trialDuration * trial.startRotate.trialcount; But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer exists, instead it's been replaced by six independent test1, test2, ..., test6 trials. Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. Do you have any suggestions as to how I could amend these expressions to collect the data correctly, given my study design? > But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer > exists, instead it's been replaced by six independent test1, test2, ..., test6 trials Your expression fails to account for the amount of rotation trials administered -- which is obviously necessary if you want to track the amount of time spent on target *across multiple rotation trials*. You need to adjust for that, otherwise the math is plainly wrong. That doesn't change just because you split things into separate <trial>s -- <trial test1> to <trial test6> -- you need to count those and that has to factor into the expression. > Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. How so? Show me, please.
|
|
|
aquirk
|
|
Group: Forum Members
Posts: 31,
Visits: 70
|
+x+x+x+xI've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block> The expression you have here <expressions> ... / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; ... </expression> is nothing like the original expression and will obviously not calculate / return the total time spent on target across trials. Compare to the original: / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration*trial.startRotate.trialcount) - expressions.sum_offDurations_total else parameters.trialDuration * trial.startRotate.trialcount; But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer exists, instead it's been replaced by six independent test1, test2, ..., test6 trials. Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. Do you have any suggestions as to how I could amend these expressions to collect the data correctly, given my study design? > But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer > exists, instead it's been replaced by six independent test1, test2, ..., test6 trials Your expression fails to account for the amount of rotation trials administered -- which is obviously necessary if you want to track the amount of time spent on target *across multiple rotation trials*. You need to adjust for that, otherwise the math is plainly wrong. That doesn't change just because you split things into separate <trial>s -- <trial test1> to <trial test6> -- you need to count those and that has to factor into the expression. > Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. How so? Show me, please.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+x+xI've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block> The expression you have here <expressions> ... / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; ... </expression> is nothing like the original expression and will obviously not calculate / return the total time spent on target across trials. Compare to the original: / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration*trial.startRotate.trialcount) - expressions.sum_offDurations_total else parameters.trialDuration * trial.startRotate.trialcount; But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer exists, instead it's been replaced by six independent test1, test2, ..., test6 trials. Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. Do you have any suggestions as to how I could amend these expressions to collect the data correctly, given my study design? > But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer > exists, instead it's been replaced by six independent test1, test2, ..., test6 trials Your expression fails to account for the amount of rotation trials administered -- which is obviously necessary if you want to track the amount of time spent on target *across multiple rotation trials*. You need to adjust for that, otherwise the math is plainly wrong. That doesn't change just because you split things into separate <trial>s -- <trial test1> to <trial test6> -- you need to count those and that has to factor into the expression. > Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. How so? Show me, please. I'm not seeing any negative values in expressions.timeontarget_trial. Attach the full data file, please.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
And as for the issue with your timeontarget_total expression, the way to fix that is like so: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor*Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / rotationtrialcount = 0/ completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN) (parameters.trialDuration*values.rotationtrialcount) - expressions.sum_offDurations_total else parameters.trialDuration * values.rotationtrialcount;/ meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / ontrialbegin = [ values.rotationtrialcount += 1; ]/ stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / ontrialbegin = [ values.rotationtrialcount += 1; ]/ stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / ontrialbegin = [ values.rotationtrialcount += 1; ]/ stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / ontrialbegin = [ values.rotationtrialcount += 1; ]/ stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / ontrialbegin = [ values.rotationtrialcount += 1; ]/ stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / ontrialbegin = [ values.rotationtrialcount += 1; ]/ stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block>
|
|
|
aquirk
|
|
Group: Forum Members
Posts: 31,
Visits: 70
|
+x+x+x+x+x+xI've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block> The expression you have here <expressions> ... / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; ... </expression> is nothing like the original expression and will obviously not calculate / return the total time spent on target across trials. Compare to the original: / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration*trial.startRotate.trialcount) - expressions.sum_offDurations_total else parameters.trialDuration * trial.startRotate.trialcount; But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer exists, instead it's been replaced by six independent test1, test2, ..., test6 trials. Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. Do you have any suggestions as to how I could amend these expressions to collect the data correctly, given my study design? > But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer > exists, instead it's been replaced by six independent test1, test2, ..., test6 trials Your expression fails to account for the amount of rotation trials administered -- which is obviously necessary if you want to track the amount of time spent on target *across multiple rotation trials*. You need to adjust for that, otherwise the math is plainly wrong. That doesn't change just because you split things into separate <trial>s -- <trial test1> to <trial test6> -- you need to count those and that has to factor into the expression. > Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. How so? Show me, please. I'm not seeing any negative values in expressions.timeontarget_trial. Attach the full data file, please. Sorry I'm really confused... in the picture I just sent there are three negative values, no? Here's the full datafile:
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+x+x+x+xI've adapted the pursuit rotor task so that participants can randomly see circles spinning at different speeds, but the way I did it seems to have messed up the data collection. Sometimes it says the amount of time on the circle is negative, which makes no sense. I've pasted the script below: PURSUIT ROTOR TASK SCRIPT INFO original Coder: Jeffrey Q. Ouyang ( qijia.ouyang@gmail.com) last updated: 08-15-2016 by K.Borchert, Ph.D. ( katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 08-15-2016 Millisecond Software BACKGROUND INFO *Purpose* This script implements the Pursuit Rotor Task; a task to measure manual dexterity and visual-motor tracking abilities. References: -The Multivariate Study of Pursuit Rotor Skill Development, 11 Aug. 2011, http://www.science.smith.edu/departments/EXER_SCI/Faculty/DS/PR.html-Measuring Hand/Eye Coordination, 11 Aug. 2011, http://www.psywww.com/intropsych/ch07_cognition/measuring_hand_eye_coordination.html-Pursuit Rotor, 11 Aug. 2011, http://sourceforge.net/apps/mediawiki/pebl/index.php?title=Pursuit_Rotor *Task* Participant tracks a red target with mouse cursor, as the target moves steadily in a circular path. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'PursuitRotor_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 /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) 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 data is collected unless /recorddata = false is set for a particular trial/block) /sum_offDurations_trial:the sum of the durations spent OFF the target disk per trial (in ms) /timeOnTarget_trial:the duration spent ON the target disk per trial (in ms) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle per trial /meanOffDistanceDisc_trial:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)per trial /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse position from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center)across trials list.targetDistances_trial.itemcount: stores the number of recorded mouse movements per trial list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the distance data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable (2) Summary data file: 'PursuitRotor_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) /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixels) used for the task /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /NumTrials:the number of trials to run (default: 4) /sum_offDurations_total:the sum of the durations spent OFF the target disk across all trials (in ms) list.targetDistances_total.itemcount: stores the number of recorded mouse movements across trials Note: the (distance) data should only be considered valid if participant continously moved the mouse around; if few mouse movements are recorded, the collected distance data are questionable /timeOnTarget_total:the duration spent ON the target disk across trials (in ms) /meanDistanceFromCenterDisc_total:the mean distance (in pixels) of recorded mouse positions from the center of the animated circle across trials /meanOffDistanceDisc_total:the mean distance (in pixels) of recorded mouse positions from the target disc (to edges of disc; not the center) across trials EXPERIMENTAL SET-UP - task runs 4 trials (default; can be edited under section Editable Parameters) on a 800px x 600px canvas (default; can be edited under section Defaults) - each trial takes 10s (default; can be edited under section Editable Parameters) - when participant move the mouse; mouse position is compared to disc position (Note: task relies on participant continously moving the mouse; if no movements occur, data are not updated and summary values are questionnable) INSTRUCTIONS can be edited under section Instructions EDITABLE CODE: check 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: /trialDuration:the duration of one trial/one rotation in ms (default: 10000ms) /radius:the radius of the track in pixels /targetDiscSize:the size of the target disc in pixels /NumTrials:the number of trials to run (default: 4) </usermanual> ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** <parameters> / trialDuration = 1000 / radius = 225px / targetDiscSize = 50 / restTime = 1000 / NumTrials = 7 / rotationtime1 = 1000 / rotationtime2 = 1400 / rotationtime3 = 1800 / rotationtime4 = 2200 / rotationtime5 = 2600 / rotationtime6 = 3000 / rotations = 20 / highscore = 2 / finalresttime = 40000 </parameters> ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** <item instructions> / 1 = "In this task, you will track a blue circle moving steadily around a circular track. ~nTry to keep your <%expressions.buttoninstruct1%> on the blue circle at all times. ~nThere will be a total of <%parameters.NumTrials%> trials, each lasting <%parameters.trialDuration/1000%> seconds. ~nYou will have <%parameters.restTime/1000%> seconds to rest in between each trial. ~n<%expressions.buttoninstruct2%> to begin." / 2 = "Position your <%expressions.buttoninstruct1%> on the blue circle and try to stay on the circle at all times. ~n<%expressions.buttoninstruct2%> to begin - the circle will start moving immediately." / 3 = "You can now rest for <%parameters.restTime/1000%> seconds before the next trial. ~n<%expressions.buttoninstruct2%> if you would like to continue immediately." / 4 = "Thank you! To receive payment, please enter the following code on MTurk: <%values.MTURK%>. This page will close after 30 seconds." / 5 = "We'd like to know a bit about what you thought about this HIT. Below, please write any comments you think would be useful to pass on to us. For instance, do you think you were paid a fair amount of money for the amount of work you did? Is there something we can do to make the directions clearer? Is there anything we can do to make the HIT more interesting? Any feedback would be helpful!" </item> **************************************************************************************************** general instruction expressions: adjust the instruction text depending on device used to run script **************************************************************************************************** <expressions> / buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"finger";} else {"mouse cursor";} / buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Tap your screen";} else {"Click the mouse";} </expressions> ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 5.0.1.0 or later <defaults> / screencolor = whitesmoke / txbgcolor = transparent / txcolor = white / minimumversion = "5.0.1.0" / canvassize = (800px, 600px) / inputdevice = mouse </defaults> ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* 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.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, blockcode, blocknum, trialcode, trialnum, expressions.sum_offDurations_trial, expressions.timeOnTarget_trial, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_trial, expressions.meanOffDistanceDisc_trial, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total, list.targetDistances_trial.itemcount, list.targetDistances_total.itemcount, openended.question.response) </data> *********************** summary data file *********************** <summarydata> / columns = (script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, values.usedCanvas, parameters.radius, parameters.targetDiscSize, parameters.trialDuration, list.targetDistances_total.itemcount, expressions.sum_offDurations_total, expressions.timeOnTarget_total, expressions.meanDistanceFromCenterDisc_total, expressions.meanOffDistanceDisc_total) / separatefiles = true </summarydata> ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed:0 = script was not completed; 1 = script was completed (all conditions run) /previous_targetlocation:1 = mouse was previously ON target disc; 0 = mouse was previously OFF target task /startOffTarget:records the script.elapsedtime when mouse goes off target /offDuration:stores the duration (in ms) of the last time spent OFF target disc /usedCanvas:data file variable that stores the dimension of the experimental canvas (in pixel) used for the task <values> / completed = 0 / previous_targetlocation = 1 / current_targetlocation = 0 / startOffTarget = 0 / offDuration = 0 / usedCanvas = "(" / MTURK = 0 </values> ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /usedCanvas:assembles a variable for the data file that contains the used canvas pixel information /radius_outerTrack:calculates the radius of the outter track circle in pixels /radius_innerTrack:calculates the radius of the inner track circle in pixels /distance:calculates the distance of the current mouse position from the center of the animated circle in pixels /sum_offDurations_trial:calculates the sum of the durations spent off the target disk per trial (in ms) /sum_offDurations_total:calculates the sum of the durations spent off the target disk across all trials (in ms) /timeOnTarget_trial:calculates the duration spent on the target disk per trial (in ms) /timeOnTarget_total:calculates the duration spent on the target disk across trials (in ms) /meanDistanceFromCenterDisc_trial:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial /meanDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials /meanOffDistanceFromCenterDisc_trial:calulates the mean distance (in pixels) from of the mouse position from the center of the animated circle per trial for mouse positions OFF target /meanOffDistanceFromCenterDisc_total:calculates the mean distance (in pixels) from of the mouse position from the center of the animated circle across trials for mouse positions OFF target /meanOffDistanceDisc_trial:calulates the mean distance (in pixels) from of the mouse position outside of the disc per trial /meanOffDistanceDisc_total:calulates the mean distance (in pixels) from of the mouse position outside of the disc across trials <expressions> / usedCanvas = { values.usedCanvas = concat(values.usedCanvas, display.canvaswidth); values.usedCanvas = concat(values.usedCanvas, "px, "); values.usedCanvas = concat(values.usedCanvas, display.canvasheight); values.usedCanvas = concat(values.usedCanvas, "px)"); } / radius_outerTrack = 1px * parameters.radius*1.03 / radius_innerTrack = 1px * parameters.radius*0.97 / distance1 = sqrt(pow((mouse.x - shape.animatedCircle1.hposition),2) + pow((mouse.y - shape.animatedCircle1.vposition),2)); / distance2 = sqrt(pow((mouse.x - shape.animatedCircle2.hposition),2) + pow((mouse.y - shape.animatedCircle2.vposition),2)); / distance3 = sqrt(pow((mouse.x - shape.animatedCircle3.hposition),2) + pow((mouse.y - shape.animatedCircle3.vposition),2)); / distance4 = sqrt(pow((mouse.x - shape.animatedCircle4.hposition),2) + pow((mouse.y - shape.animatedCircle4.vposition),2)); / distance5 = sqrt(pow((mouse.x - shape.animatedCircle5.hposition),2) + pow((mouse.y - shape.animatedCircle5.vposition),2)); / distance6 = sqrt(pow((mouse.x - shape.animatedCircle6.hposition),2) + pow((mouse.y - shape.animatedCircle6.vposition),2)); / sum_offDurations_trial = list.offDurations_trial.mean * list.offDurations_trial.itemcount / sum_offDurations_total = list.offDurations_total.mean * list.offDurations_total.itemcount / timeOnTarget_trial = if (expressions.sum_offDurations_trial !="nan") { parameters.trialDuration - expressions.sum_offDurations_trial; } else { parameters.trialDuration; } / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; / meanDistanceFromCenterDisc_trial = list.targetDistances_trial.mean / meanDistanceFromCenterDisc_total = list.targetDistances_total.mean / meanOffDistanceFromCenterDisc_trial = list.offTargetDistance_trial.mean / meanOffDistanceFromCenterDisc_total = list.offTargetDistance_total.mean / meanOffDistanceDisc_trial = expressions.meanOffDistanceFromCenterDisc_trial - parameters.targetDiscSize / meanOffDistanceDisc_total = expressions.meanOffDistanceFromCenterDisc_total - parameters.targetDiscSize </expressions> <expressions> / static_x = 50% + parameters.radius </expressions> ******************************************************************************************************************* ******************************************************************************************************************* INSTRUCTIONS ******************************************************************************************************************* ******************************************************************************************************************* <text IntroTxt> / items = instructions / select = 1 / fontstyle = ("Verdana", 2%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (40%, 20%) / hjustify = left / valign = center </text> <text BeforeTest> / items = ("The test will begin in <%parameters.resttime/1000%> seconds.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest1> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest> / items = ("Here is how many seconds you've been able to stay on the blue circle during each trial so far: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nSo far your high score is <%list.ontargettimes.maximum/1000%> seconds. Let's see if you can beat that score on the next trial! ~nYou have <%parameters.resttime/1000%> seconds to rest.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest2> / items = ("Here is how many seconds you were able to stay on the blue circle during each trial: ~nTrial 1: <%item.ontargettimes.item.1/1000%> Trial 2: <%item.ontargettimes.item.2/1000%> Trial 3: <%item.ontargettimes.item.3/1000%> Trial 4: <%item.ontargettimes.item.4/1000%> Trial 5: <%item.ontargettimes.item.5/1000%> Trial 6: <%item.ontargettimes.item.6/1000%> Trial 7: <%item.ontargettimes.item.7/1000%> Trial 8: <%item.ontargettimes.item.8/1000%> ~nYour high score was <%list.ontargettimes.maximum/1000%> seconds. Good work! ~n<%expressions.buttoninstruct2%> to continue.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 20%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest4> / items = ("You now have <%parameters.restTime/1000%> seconds to rest before the next test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text BetweenTest3> / items = ("Now you are going to complete the first test phase. There will be six test trials with the circle moving at different speeds. Each trial will be <%parameters.trialDuration/1000%> seconds. Sometimes the speed may be the same as it was during your practice trials. Other times it may be faster or slower. ~nOne important change is that the black track the circle was following during the practice will now be hidden. ~nTry to keep your mouse on the circle as much as possible! We'll tell you how you did when this phase of the test is over. ~n<%expressions.buttoninstruct2%> to continue to the first test trial.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 30%) / size = (50%, 15%) / hjustify = left / valign = center </text> <text InstructTxt> / items = instructions / select = 2 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (30%, 30%) / hjustify = left / valign = center </text> <text OpenTxt> / items = instructions / select = 5 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (400px, 300px) / size = (50%, 50%) / hjustify = left / valign = center </text> <text PostTestTxt> / items = instructions / select = 4 / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 50%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text scoretext> / items = ("Good job! You have finished the first test. You were able to keep your mouse on the circle for <%expressions.timeOnTarget_total/1000%> seconds during all six trials. Great work! You now have <%parameters.finalresttime/1000%> seconds to rest, then you will complete the second test.") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text one> / items = ("1") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text two> / items = ("2") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text three> / items = ("3") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text four> / items = ("4") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text five> / items = ("5") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <text six> / items = ("6") / fontstyle = ("Verdana", 2.5%, false, false, false, false, 5, 0) / txcolor = black / position = (50%, 40%) / size = (20%, 15%) / hjustify = left / valign = center </text> <item ontargettimes> </item> <radiobuttons competence> /caption = "I performed very well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons effort> /caption = "I put a lot of effort into the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons motivation> /caption = "I was motivated to do well during the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons difficult> /caption = "The training was very difficult." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons enjoyment> /caption = "I enjoyed the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons pleasant> /caption = "The training was pleasant." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons fun> /caption = "The training was fun." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons useful> /caption = "The training was useful." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons benefit> /caption = "I benefitted from the training." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> <radiobuttons helpful> /caption = "The training was helpful in improving my skills." / options = ("Strongly Disagree", "Disagree", "Slightly Disagree", "Neither Agree nor Disagree", "Slightly Agree", "Agree", "Strongly Agree") /required = true /orientation = vertical </radiobuttons> ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* Note: creates the inner circle (where instructions are posted)/track line <shape innerTrack> / shape = circle / size = (expressions.radius_innerTrack*2,expressions.radius_innerTrack*2) / position = (50%,50%) / color = whitesmoke / erase = false </shape> Note: creates the outer track line <shape outerTrack> / shape = circle / size = (1px * expressions.radius_outerTrack*2, 1px*expressions.radius_outerTrack*2) / position = (50%,50%) / color = black / erase = false </shape> <shape animatedCircle1> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime1, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle2> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime2, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle3> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime3, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle4> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime4, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle5> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime5, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape animatedCircle6> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / animation = circle(parameters.rotationtime6, parameters.rotations, 0, 50%, 50%, parameters.radius) / color = cornflowerblue / erase = false </shape> <shape staticCircle> / shape = circle / size = (parameters.targetDiscSize, parameters.targetDiscSize) / hposition = 1px * (display.canvaswidth/2 + parameters.radius) / vposition = 1px * (display.canvasheight/2) / color = cornflowerblue / erase = false </shape> ******************************************************************************************************************* ******************************************************************************************************************* LISTS ******************************************************************************************************************* ******************************************************************************************************************* ************************************************* Data Lists: used for descriptive statistics store correct latencies/accuracy data fill up during runtime ************************************************* Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc per trial <list targetDistances_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement from the center of the target disc across trials <list targetDistances_total> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) per trial <list offTargetDistance_trial> </list> Note: stores the distance (in pixels) of each recorded mouse movement that are OFF the target disc from the disc (edge of disc) across trials <list offTargetDistance_total> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target per trial <list offDurations_trial> </list> Note: stores the duration (in ms) of each recorded mouse movement that are OFF the target across trials <list offDurations_total> </list> <list ontargettimes> / items = (item.ontargettimes.item.1, item.ontargettimes.item.2, item.ontargettimes.item.3, item.ontargettimes.item.4, item.ontargettimes.item.5, item.ontargettimes.item.6, item.ontargettimes.item.7, item.ontargettimes.item.8) </list> ******************************************************************************************************************* ******************************************************************************************************************* TRIALS ******************************************************************************************************************* ******************************************************************************************************************* <trial testrest> / stimulusframes = [1 = clearscreen, BeforeTest] / timeout = parameters.restTime / branch = [ trial.starttest; ] / recorddata = false </trial> <trial beginning> / stimulusframes = [1 = clearscreen, BetweenTest3] / validresponse = (lbuttondown) / recorddata = false </trial> <trial starttest> / stimulusframes = [1 =innerTrack, staticCircle, InstructTxt] / validresponse = (staticCircle) / ontrialend = [ values.previous_targetlocation = 1; list.offDurations_trial.reset(); list.targetDistances_trial.reset(); list.offTargetDistance_trial.reset(); ] / recorddata = false </trial> <trial test1> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle1] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test1.response == "mousemove" && expressions.distance1 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_trial.insertitem(expressions.distance1, 1); list.offTargetDistance_total.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test1.response == "mousemove" && expressions.distance1 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance1, 1); list.targetDistances_trial.insertitem(expressions.distance1, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test2> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle2] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test2.response == "mousemove" && expressions.distance2 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_trial.insertitem(expressions.distance2, 1); list.offTargetDistance_total.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test2.response == "mousemove" && expressions.distance2 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance2, 1); list.targetDistances_trial.insertitem(expressions.distance2, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test3> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle3] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test3.response == "mousemove" && expressions.distance3 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_trial.insertitem(expressions.distance3, 1); list.offTargetDistance_total.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test3.response == "mousemove" && expressions.distance3 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance3, 1); list.targetDistances_trial.insertitem(expressions.distance3, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test4> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle4] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test4.response == "mousemove" && expressions.distance4 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_trial.insertitem(expressions.distance4, 1); list.offTargetDistance_total.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test4.response == "mousemove" && expressions.distance4 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance4, 1); list.targetDistances_trial.insertitem(expressions.distance4, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test5> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle5] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test5.response == "mousemove" && expressions.distance5 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_trial.insertitem(expressions.distance5, 1); list.offTargetDistance_total.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test5.response == "mousemove" && expressions.distance5 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance5, 1); list.targetDistances_trial.insertitem(expressions.distance5, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial test6> / stimulusframes = [1 = clearscreen, innerTrack, animatedCircle6] / validresponse = (mousemove) / isvalidresponse = [ if (trial.test6.response == "mousemove" && expressions.distance6 > parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_trial.insertitem(expressions.distance6, 1); list.offTargetDistance_total.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 1) { values.startOffTarget = script.elapsedtime; values.previous_targetlocation = 0; } ; 1 == 1; } else if (trial.test6.response == "mousemove" && expressions.distance6 <= parameters.targetDiscSize) { list.targetDistances_total.insertitem(expressions.distance6, 1); list.targetDistances_trial.insertitem(expressions.distance6, 1); if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); values.previous_targetlocation = 1; } ; 1 == 1; } ] / ontrialend = [ if (values.previous_targetlocation == 0) { values.offDuration = script.elapsedtime - values.startOffTarget; list.offDurations_total.insertitem(values.offDuration, 1); list.offDurations_trial.insertitem(values.offDuration, 1); } ; ] / response = correct / iscorrectresponse = [ 3 == 4 ] / timeout = parameters.trialDuration / recorddata = true / branch = [ if (trial.posttest.trialcount < 5) { trial.posttest; } else { trial.score; } ] </trial> <trial posttest> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, BetweenTest4] / timeout = parameters.restTime / recorddata = false / branch = [ trial.starttest ] </trial> <trial score> / ontrialbegin = [ item.ontargettimes.appenditem(expressions.timeOnTarget_trial) ] / stimulusframes = [1 = clearscreen, scoretext] / timeout = parameters.finalresttime / recorddata = false </trial> <block test1> / trials = [1=beginning; 2=starttest; 3-8=noreplacenorepeat(test1,test2,test3,test4,test5,test6); 9=score] </block> The expression you have here <expressions> ... / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration) - expressions.sum_offDurations_total else parameters.trialDuration; ... </expression> is nothing like the original expression and will obviously not calculate / return the total time spent on target across trials. Compare to the original: / timeOnTarget_total = if (expressions.sum_offDurations_total !=NaN)(parameters.trialDuration*trial.startRotate.trialcount) - expressions.sum_offDurations_total else parameters.trialDuration * trial.startRotate.trialcount; But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer exists, instead it's been replaced by six independent test1, test2, ..., test6 trials. Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. Do you have any suggestions as to how I could amend these expressions to collect the data correctly, given my study design? > But all I changed was deleting the multiplying factor of the number of times the Rotate trial had run. I did this because the repeating Rotate trial no longer > exists, instead it's been replaced by six independent test1, test2, ..., test6 trials Your expression fails to account for the amount of rotation trials administered -- which is obviously necessary if you want to track the amount of time spent on target *across multiple rotation trials*. You need to adjust for that, otherwise the math is plainly wrong. That doesn't change just because you split things into separate <trial>s -- <trial test1> to <trial test6> -- you need to count those and that has to factor into the expression. > Also, I didn't change timeOnTarget_trial at all, but that isn't calculating correctly either. How so? Show me, please. I'm not seeing any negative values in expressions.timeontarget_trial. Attach the full data file, please. Sorry I'm really confused... in the picture I just sent there are three negative values, no? Here's the full datafile: > Sorry I'm really confused... in the picture I just sent there are three negative values, no? In my test runs using your script, I am not getting any negative values in expressions.timeontarget_trial
|
|
|