Post by throwaway on Jan 20, 2021 13:32:25 GMT
Hi, so I'm running a Posner task and I want absolute unix timestamps (since 1970) to be displayed in the data marking each moment the user responds to a stimulus. You can see below the code I ran where I tried to implement the timestamps (underlined and boldened). However, my attempt failed as shown in the data which I copied and pasted below the code. What should I do to fix things?
# every line starting with # is comment
options
bitmapdir stimuli # the folder that contains the stimuli bitmaps
escape
# the following section defines the bitmaps. the default format for
# bitmaps is "png" if you use png files, you do not need to use the
# extension.
bitmaps
cuesignal # this refers to the file cuesignal.png
gosignal
fixpoint1 # small
fixpoint2 # medium
fixpoint3 # large
box
instruction
afterwords
mistakefeedback
fonts
arial 20
# the table section contains 4 rows, one for each of the four
# conditions the stuff in quatation marks is human readable
# information, the program doesn't really need it.
table cueingtable
"cueleft targetleft valid cued 1" -200 -200 1
"cueleft targetleft valid cued 1" -200 -200 1
"cueleft targetleft valid cued 1" -200 -200 1
"cueright targetleft invalid uncued 0" 200 -200 1
"cueright targetright valid cued 1" 200 200 2
"cueright targetright valid cued 1" 200 200 2
"cueright targetright valid cued 1" 200 200 2
"cueleft targetright invalid uncued 0" -200 200 2
# the task describes exactly one trial. On each each trial, one of the
# rows of the cue table is chosen at random
task cueingtask
table cueingtable
keys a l
delay 500 # time between trials
draw off
show bitmap fixpoint1
show bitmap box -200 0
show bitmap box 200 0
draw on
delay 75
show bitmap fixpoint2
delay 75
show bitmap fixpoint3
delay 75
clear 4 5
show bitmap fixpoint2
delay 75
clear 6
show bitmap fixpoint1
delay 200
show bitmap cuesignal @2 0 # now show the cue
delay 75
clear -1
delay 75
show bitmap gosignal @3 0 # show target (go) 700 ms later
readkey @4 1500
timestamp myTimeStamp
set $time_in_sec timestamp-seconds myTimeStamp
set $rest_time_in_ms timestamp-milliseconds myTimeStamp
set $absolute_time expression $time_in_sec * 1000 + $rest_time_in_ms
save $time_in_sec $rest_time_in_ms $absolute_time
clear -1
if STATUS != CORRECT
show bitmap mistakefeedback 0 200
delay 2000
clear -1
fi
save @1 RT STATUS # this saves the data to an output file
block cueingblock
message instruction
tasklist
cueingtask 10 # do the task 100 times
end
bitmap afterwords
wait_for_key
feedback
text align left
set &RTvalid mean c6 ; select c7 == 1 && c5 == 1
set &RTinvalid mean c6 ; select c7 == 1 && c5 == 0
text -300 0 "Response time (ms)"
text -300 50 &RTvalid ; prefix "Valid cue conditions: " ; postfix " ms"
text -300 100 &RTinvalid ; prefix "Invalid cue conditions: " ; postfix " ms"
text -300 250 "Press space bar to continue"
end
0 0 0
cueright targetright valid cued 1 1000 1
0 0 0
cueleft targetleft valid cued 1 1500 3
0 0 0
cueleft targetleft valid cued 1 432 1
0 0 0
cueleft targetleft valid cued 1 389 1
0 0 0
cueright targetright valid cued 1 212 1
0 0 0
cueleft targetleft valid cued 1 315 1
0 0 0
cueright targetright valid cued 1 282 1
0 0 0
cueleft targetleft valid cued 1 350 1
0 0 0
cueright targetright valid cued 1 250 1
0 0 0
cueleft targetleft valid cued 1 232 1