In my experiment, I present participants words then ask them to recall from list of 6 words.
I show them a random color e.g. “Blue Phone” word (encode), then they should find the color among 6 options (position is randomized) by clicking on the Blue Phone (retrieve).
There are different routines for encoding and retrieval phases. The .xlsx file has word1, word2,… columns for encoding and mywordlist1x mywordlist2x… for retrieval. color in the word1 always matches with mywordlist1x and the same is the case for the rest of the options. I mean, word1 and mywordlist1x correspond to “Blue Phone”.
This is the part where a random word is selected as Blue among 6 alternatives.
if wordmousep.isPressedIn(mywordlist1p): #mywordlist1p is the name of the component calling $mywordlist1x
word_accuracy = 1
thisExp.addData('word_accuracy', word_accuracy)
else:
word_accuracy = 0
thisExp.addData('word_accuracy', word_accuracy)
However, I do not know where to locate this code within the randomization or if it is the correct way to do. Your help is much appreciated.
Sorry, I am not sure if I understand you correctly.
Where should I define “correctAns” variable? What is [-1] item in the mouse.clicked_name? In the data, mouse.clicked_name is the component that was clicked, e.g. mywordlist3p. S
I do not know which component to be clicked because encoded items will be randomly determined by the code.