I’m relatively new to using the coder component in PsychoPy builder, so I would really appreciate some advice on how to tackle this. This experiment will be run locally and not online (so no need for JS).
The experiment asks participants to watch a video stimulus, then replicate the position of objects on a blank canvas. I have set up the stimulus routine, and the response routine (following advice from Drag & Drop Stimuli). But I’m not sure how to export the response - i.e., the pixel position of the objects. I don’t necessarily want to export ‘correct’ responses, but the accuracy of position (which I will calculate as error, retrospectively). So all I want to do is export the positions of objects at the end of each routine. I assume this will be added to the data CSV file produced at the end of each trial, but if it’s easier to create a new file then this is fine too.
I hope that makes sense Let me know if you can help!
This didn’t add any data to the output CSV file. But it did add some data lines to the stdout code. See DATA positions below. I didn’t have these lines before.
Ah sorry, as I’m still building the experiment I hadn’t added a function to ‘end’ the routine yet, so I was using escape to quit the routine not realising that the data wouldn’t be saved if I left before the end of the routine. My bad…
I have now added a keyboard press to end the routine. Using the first code you sent:
for Idx in range(len(pieces)):
thisExp.addData(‘Pos’+str(Idx),pieces[Idx].pos)
I now have the new columns in the data file called Pos0, Pos1 (etc.) as coordinates, e.g, [-0.56 -0.31]. Thanks so much for your help! I’m not entirely clear on which object each PosX value relates to, can I assume it’s the order of the objects in the routine? Or is there a way I can label them according to the names of the image files?