PennController for IBEX › Forums › Support › Some results not captured
- This topic has 3 replies, 2 voices, and was last updated 4 years, 1 month ago by Jeremy.
-
AuthorPosts
-
November 27, 2020 at 2:21 pm #6389carlapParticipant
Hi,
I have a situation where, apparently at random, some of my results (approx 2%) don’t include the necessary information. As you can see below, the first result (item number 60) includes after [Header_,End] the sections [Timer,timeout, Start] and [Timer timeout, End] and I can use this to capture the reaction time. However, item number 68 doesn’t include these two lines – it jumps straight to [Key, pressOnArrow] – but since it doesn’t include the Timer start, I can’t calculate the reaction time. Any thoughts on 1) Can I somehow recover this data? or 2) How I should alter my script to avoid this problem?
Both these items are from the same Template and Trial (What I think is the relevant portion of the script is included below the results examples)
Thanks!
[ITEM 60]
1601524994,REDACTED,PennController,60,0,Experimento_espanol_nivel_2,NULL,PennController,70,_Trial_,Start,1601524184167,ArrowRight,anmd0,NULL 1601524994,REDACTED,PennController,60,0,Experimento_espanol_nivel_2,NULL,PennController,70,_Header_,Start,1601524184167,ArrowRight,anmd0,NULL 1601524994,REDACTED,PennController,60,0,Experimento_espanol_nivel_2,NULL,PennController,70,_Header_,End,1601524184421,ArrowRight,anmd0,NULL 1601524994,REDACTED,PennController,60,0,Experimento_espanol_nivel_2,NULL,Timer,timeout,Start,Start,1601524186606,ArrowRight,anmd0,NULL 1601524994,REDACTED,PennController,60,0,Experimento_espanol_nivel_2,NULL,Timer,timeout,End,End,1601524188377,ArrowRight,anmd0,NULL 1601524994,REDACTED,PennController,60,0,Experimento_espanol_nivel_2,NULL,Key,pressOnArrow,PressedKey,ARROWRIGHT,1601524188377,ArrowRight,anmd0,NULL 1601524994,REDACTED,PennController,60,0,Experimento_espanol_nivel_2,NULL,PennController,70,_Trial_,End,1601524188764,ArrowRight,anmd0,NULL
[ITEM 68]
1601524994,REDACTED,PennController,68,0,Experimento_espanol_nivel_2,NULL,PennController,78,_Trial_,Start,1601524181855,ArrowLeft,anmd0,NULL 1601524994,REDACTED,PennController,68,0,Experimento_espanol_nivel_2,NULL,PennController,78,_Header_,Start,1601524181855,ArrowLeft,anmd0,NULL 1601524994,REDACTED,PennController,68,0,Experimento_espanol_nivel_2,NULL,PennController,78,_Header_,End,1601524182109,ArrowLeft,anmd0,NULL 1601524994,REDACTED,PennController,68,0,Experimento_espanol_nivel_2,NULL,Key,pressOnArrow,PressedKey,ARROWRIGHT,1601524184153,ArrowLeft,anmd0,NULL 1601524994,REDACTED,PennController,68,0,Experimento_espanol_nivel_2,NULL,PennController,78,_Trial_,End,1601524184163,ArrowLeft,anmd0,NULL
[SCRIPT]
Template("Math_Spanish_Level_1_2_Bloque1.csv" , row => newTrial( "Experimento_espanol_nivel_1" , newImage("fixationpoint", row.Fixation) .size(100,100) .print() , newAudio("primero",row.First_Operand) .play() , newTimer(700).start() .wait() , newAudio("segundo", row.Second_Operand) .play() , newTimer(1150).start() .wait() , getImage("fixationpoint") .remove() , newText("num", row.Solution) .css("color","white") .css("font-size", "200px") .print() , newKey("pressOnArrow", "ArrowLeft", "ArrowRight") .log("all") .callback( getTimer("exposure").stop(), getTimer("timeout").stop() ) , newTimer("exposure", 300).start().wait() , getText("num").remove() , getKey("pressOnArrow").test.pressed() .failure( newTimer("timeout", 5000).start().log().wait() ) , getKey("pressOnArrow") .disable() .test.pressed( row.Correct_answer ) .success( newAudio("coin7.mp3").play().wait() ) ) .log( "Correct_answer" , row.Correct_answer ) .log( "ID" , getVar("ID") ))
November 27, 2020 at 3:42 pm #6390JeremyKeymasterHi,
This doesn’t happen at random, it’s just consistent with your script: you only start and log the “timeout” Timer element if no key was pressed during the exposure period, otherwise you just never even deal with that Timer element, so it won’t appear in your results files. Here’s a step-by-step reading of your script (the “any time”s correspond to whether the participant pressed a key that would stop the timers prematurely):
0ms print "fixationpoint" ; print "primero" start playing "primero" ; start 700ms timer and wait [ ... ] 700ms start playing "segundo" ; start 1150ms timer and wait [ ... ] 1850ms remove "fixationpoint" ; print "num" listen to keypresses on left/right arrow (will be logged) associate keypresses with [ stop "exposure" ; stop "timeout" ] start 300ms "exposure" timer and wait [ ... ] any time remove "num" btw 1850 **if NO key was pressed (2150ms)**: & 2150ms [ start 5000ms "timeout" timer (will be logged) and wait ] any time stop listening to keypresses btw 1850 **if correct key was pressed*: & 7150ms [ play "coin7" and wait ] any time end of current trial btw 1850 move to next trial & 7150 + audio ms
Consistently, you’ll find that for item 60, 3956ms elapsed between the reported keypress and the end of your Header, which necessarily means that no key was pressed during the exposure timer (which takes place between 1850 and 2150ms). For item 68, however, the keypress happened 2044ms after the end of your Header, which means approximately 100ms before the end of the “exposure” timer (or, 200ms after it started). So the failure command on the Key was just not validated (ie. a key had been pressed indeed at that point) and the “timeout” timer was just never started nor told to be logged. So there’s not really any data to recover here, because the “data” doesn’t correspond to anything that actually happened.
Don’t you get the desired reaction time by subtracting the Header-end time event from the keypress time event though, the way I just did?
You could also add log onto your “exposure” Timer element, which will add a line reporting when it started (and ended), so you can subtract the start time event from the keypress. It would probably more accurately reflect the reaction time you’re after, as I understand your design
Jeremy
November 27, 2020 at 7:21 pm #6393carlapParticipantThanks for the explanation. I can’t do the calculation the way you did it since I am interested in calculating from the exposure timeout until the key press. So… Am I correct that if I want that, I have to add 300ms to the interval between the timeout timer and the key press? I think I see how I can also do the back calculation for the others too.
Thanks!
November 28, 2020 at 3:36 am #6396JeremyKeymasterSorry, my explanations of the timeline weren’t clear, so I will walk through them in more detail.
The first lines, the ones with “0ms” on the left, correspond to the execution of the lines from your script starting with newImage("fixationpoint", row.Fixation), which is executed immediately after the end of your Header, up to newTimer(700).start().wait(): all of them are executed so quickly that they virtually take no time, which is why I associated them all to the 0ms time point.
After the two wait commands on your first (unnamed) Timer elements have finished running, the script reaches the line getImage("fixationpoint"): that’s where the timeline reaches the time point “1850ms.” All the lines from that one up to newTimer("exposure", 300).start().wait() are executed in the blink of an eye, including the callback command of your Key element. Crucially, that command has an effect lasting for most of the rest of the timeline: from that time point on, whenever the participant presses the left or the right arrow, both the “exposure” and the “timeout” Timer elements will be stopped (if they were running during the keypress, that is).
After that time point, the timeline is no longer purely deterministic, because the course of events will depend on whether the participant does or doesn’t press a key during the execution of the Timer elements. Starting at time point 1850ms, the “exposure” Timer element starts and will run for 300ms unless the participant presses the left-arrow or right-arrow key. If the participant does not press a key, then the “exposure” Timer element elapses entirely and you are 2150ms in the trial. If the participant does press one the two arrows before that, the “exposure” Timer element is stopped prematurely and you are anywhere between 1850ms and (strictly before) 2150ms.
In either case, the “exposure” Timer element has stopped (either because it elapsed fully, or because it was ended prematurely) and the script reaches line getKey("pressOnArrow").test.pressed() and the corresponding failure command. That failure command will take effect only if the participant has not pressed one of the two arrows until then. Now remember, at this point, there are two possibilities: either the timer was ended prematurely by a keypress on one of the two arrows and the time point is not 2150ms yet, or the “exposure” Timer element has elapsed fully because no key was pressed and it has been 2150ms. Only in the latter case will the failure command take effect, and will the “timeout” Timer element start running and logging. If the participant did press a key (and it hasn’t even been 2150ms), then the “timeout” Timer element will not run and will not report any line to the results file.
This means that if your results file does report lines for the “timeout” Timer element for an item, your participant has not pressed one of the two arrow keys during the 300ms “exposure” Timer element: any relevant keypress therefore happened more than 2150ms after the end of the Header. However, if you see no such lines for an item, it means that the participant did press one of the two arrow keys before the 300ms of the “exposure” Timer element elapsed entirely, and therefore the keypress happened before 2150ms-after-the-end-of-Header. Item 60 corresponds to the first case: subtracting the time event for the keypress from the time event for the end of the Header gives 3956ms, which is well past the 2150ms signaling the end of the (uninterrupted) “exposure” Timer element. Item 68, on the other hand, corresponds to the second case: the same subtraction gives 2044ms, which is before the “exposure” Timer element has had time to fully elapse, and so the failure command did not take effect and the “timeout” Timer element was not run at all for item 68.
I hope the timecourse of events of your trials is clearer now. As I said, if you’re planning to re-run this, you could add a log command to your “exposure” Timer element so you get lines added to your results file reporting when that Timer element started (it should always be around 1850ms) and when it ended (anywhere between 1850ms and 2150ms).
Let me know if you have any questions
Jeremy
-
AuthorPosts
- You must be logged in to reply to this topic.