I inserted a “python command” block in my experiment in order to be able to log the start and end time of each trial in the psydat files.
In short, it is coded:
Begin routine: thisExp.addData(“TrialsStartTime”, globalClock.getTime())
End routine: thisExp.addData(“TrialsEndTime”, globalClock.getTime())
Unfortunately, it doesn’t seem to work. I attached the experiment file and an example of a psydat file.
Any tip would be greatly appreciated. I have no background in programming.
Only the accuracy and the response time are logged in the psydat file. The start time and end time of the trials is not logged in. I need this later information for fMRI data analysis, i.e. to know exactly at what time (relative to the start of the experiment) each trial was presented.
You’re doing everything correctly, just looking in the wrong place for the output. In your experiment settings, please switch off “Save Excel file” and “Save csv file (summaries)”. The data file you need for your analysis is obtained from “Save csv file (trial-by-trial)”.
The other two formats do some summarising and so don’t contain all the info you need – I’d actually prefer it if those options were removed, as they only cause issues.