URL of experiment: https://gitlab.pavlovia.org/S4HRI/object_selection
Description of the problem: I am creating the experiment in PsychoPy 2020.2 on a Mac. In the task, the participant selects one of two objects with the mouse, and then the face in the middle either looks at the same object or the other one. To achieve this, I added a code component that determines the gaze-direction presented in the subsequent routine, which calls on a column in my conditions file (csv) called “Following” with the values “followed, unfollowed”:
if mouse.clicked_name == 'image_left': if Following == 'followed': icubgaze = 'leftcropped300.png' elif Following == 'unfollowed': icubgaze = 'rightcropped300.png' else: print('selection error left') #continue elif mouse.clicked_name == 'image_right': if Following == 'followed': icubgaze = 'rightcropped300.png' elif Following == 'unfollowed': icubgaze = 'leftcropped300.png' else: print('selection error right') #continue else: print('selection error or code issue') #continue
(1. I blocked out the continue part as it threw the notorious
ReferenceError: frameDur is not defined. The print statements are not of much use, but for now I’m still in the middle of designing.
2. I got an
imagestim error, which I managed to resolve by manually copying my stimuli to the resources folder. As a result, there are duplicate files in separate locations, but I reckon that shouldn’t be an issue for the time being).
Long story short, the exact error I get online now, and that I need a little push with, is
ReferenceError: Following is not defined. The earlier
imagestim error made me think that something was wrong with the conditions file, but that’s all properly loaded (and so is the mouse.clicked_name at the top of the code). So, I suspect that I need to call the trialhandler more explicitly in JS. Could that be it, and more importantly, how would one do that?