OS (e.g. Win10): MacOS Mojave 10.14.6
PsychoPy version (e.g. 1.84.x): 2020.1.2
What are you trying to achieve?:
I have a routine with 6 rating scales, all showing on the screen at once. I want to make sure all of the scales have a rating before allowing the participant to continue.
What did you try to make it work?:
I have created a code component that does the following:
In “Begin Routine”
# create button that will activate once all Qs are answered
continueButton = visual.ButtonStim(win, labelText= "done", pos=(.45, -.45))
Then, in “Each Frame”
# draw continue button
continueButton.draw()
# how many questions are still unanswered?
n1 = int(nasaMental.noResponse)
n2 = int(nasaPhysical.noResponse)
n3 = int(nasaTemporal.noResponse)
n4 = int(nasaPerform.noResponse)
n5 = int(nasaEffort.noResponse)
n6 = int(nasaFrustration.noResponse)
print(n1) # for debugging
nasaUnanswered = n1 + n2 + n3 + n4 + n5 + n6
print(nasaUnanswered) # for debugging
nasaComplete = nasaUnanswered == 0
print(nasaComplete) # for debugging
# enable button when form is complete
if nasaComplete:
continueButton.buttonEnabled = True
# if activated button is pressed, proceed
if continueButton.buttonSelected:
continueRoutine = False
What specifically went wrong when you tried that?:
I can click on the scales and give ratings; however, the continue button is not enabled after I rate all 6 scales. When I print out the value of one of the scales (see above code), it seems that .noResponse is still == 1 even after I have clicked on the scale.
Any thoughts?