Hello everyone,
I’m trying to randomize the presentation of stimuli by altering the position of three texts with three different locations. During the experiment, a sentence will be followed by three texts (e.g., ansA, ansB, ansC) in which their positions will be presented in a random order. The three texts are listed on each column in Excel file.
I read several posts dealing with this topic and based on these posts I put some codes in Begin Routine as below:
To randomize the order on each trial:
positions = [[-0.6,0],[0,0],[0.6,0]]
shuffle(positions)
To create a dictionary which maps keyboard responses to their corresponding x coordinate:
key_to_x = {‘z’:-0.6, ‘v’:0, ‘m’:0.6}
To indicate the x coordinate of the chosen stimulus:
thisExp.addData(‘chosen_x’, key_to_x[Choice.keys[0])
Additionally, I input relevant attributes in Position and Text on each object (e.g., $positions [0] and $ansA, respectively), all by set every repeat.
However, the builder doesn’t run. I also put these codes in End Routine because in earlier posts it was recommended to put them in this section, but neither of them works.
What would be wrong with that?
Thank you in advance for your help.