We have tried to build this experiment on PsychoPy 2020.2.5. We hae made two textboxes (textbox1 and textbox2). Each textbox is in a loop which repeat these textboxes, respectivelly, 2 and 5 times.
Our problem is : with each textbox, we can write an answers in the first occurrence but not on next iterations. Furthermore, when we looked the encode-response, we saw that : the firts occurrence of textbox1 was encoded in textbox1.text but the second occurrence in textbox1 was encoded in textbox2. And, in Textbox2, the first occurrence was encoded in textbox2.text and others (occurrence 2, 3, 4 and 5) were not encoded at all.
We have tried these codes in order to fix this problem but it’s doesn’t work :
In End Routine :
thisExp.addData(‘this text’, textbox1._pixi.text)
In End Routine of textbox1 :
def writeRoutineEndCode(self, buff):
name = self.params[‘name’]
currLoop = self.exp.flow_loopList[-1] # last (outer-most) loop
currLoop = self.exp._expHandler
(currLoop.params[“name”], name, name))
In Begin Routine of Textbox 2 :
self.text = self.startText
Make sure box is still editable (if needed)
if self.editable and self not in self.win._editableChildren: # may yet gain focus if the first editable obj
There is an other code or any solution for help us ? Or have we made a mistake in the above code ?
Sorry for bother you again. We swear we really try to make it works