psychopy.org | Reference | Downloads | Github

Rating scale problem

Hi!

I created a script where a song plays and is rated on three dimensions. At home, with the psychopy library installed using pip (can’t check which version right now, but running on python 3), it works fine, but when I try to run it in the psychopy standalone, I get this error message:

File “C:\Progam Files\PsychoPy3\lib\site-packages\psychopy\app\runner\scriptProcess.py”, line 116, in whileRunningFile
returnVal = self.scriptProcess.poll()
AttributeError: ‘NoneType’ object has no attribute ‘poll’

This is the code for this part of the study:

def audioTrial(fragment):
“”“evaluate the fragment”""

# play sound for 10s
s = sound.Sound(fragment)
s.play()
win.flip()
core.wait(1)

# ask questions and wait for response
liking = visual.TextStim(win, text="How much do you like this song?",
                         pos=(0,0.65), height=0.05, wrapWidth=1.8)
valence = visual.TextStim(win, text="To what extent does this song evoke positive (happy/calm) or negative (sad/anger) feelings?",
                          pos=(0,0.15), height=0.05, wrapWidth=1.8)
arousal = visual.TextStim(win, text="To what extent does this song evoke feelings of energy or activity?",
                          pos=(0,-0.35), height=0.05, wrapWidth=1.8)

likingR = visual.RatingScale(win, labels=('not al all', 'very much'),
                             low=-50, high=50, markerStart=0, singleClick=True,
                             marker='slider', pos=(0,0.45), showAccept=False,
                             stretch=1.5, scale=None, textSize=0.8)
valenceR = visual.RatingScale(win, labels=('negative', 'positive'),
                             low=-50, high=50, markerStart=0, singleClick=True,
                              marker='slider', pos=(0,-0.05), showAccept=False,
                              stretch=1.5, scale=None, textSize=0.8)
arousalR = visual.RatingScale(win, labels=('very passive', 'very active'),
                             low=-50, high=50, markerStart=0, singleClick=True,
                              marker='slider', pos=(0,-0.55), showAccept=False,
                              stretch=1.5, scale=None, textSize=0.8)


while likingR.noResponse or valenceR.noResponse or arousalR.noResponse:
   liking.draw()
   likingR.draw()
   valence.draw()

   valenceR.draw()
   arousal.draw()
   arousalR.draw()
   win.flip()

s.stop()
return (likingR.getRating(), valenceR.getRating(), arousalR.getRating())