This is probably going to boil down to a logic issue with the conditional statements, but I also see an issue in the for loop.
Right now, it will only end on spacebar press if completed_ratings is exactly 1, but your code increments completed_ratings for each rating that is not null. So, if you are intending that they should advance after completing ALL ratings, then completed_ratings is greater than 1, not exactly 1.
However there may also be some issue in determining whether a rating has been filled out. I would recommend adding some logging statements to check which conditions are being met. Auto->JS will directly convert print statements to console.log statements, so here’s what the Python might look like:
keys = event.getKeys() # you'll still need to correct this after it's converted to JS
if 'space' in keys:
print("spacebar pressed, checking ratings")
completed_ratings = 0
for slider in [sliderfiller]:
if slider.getRating() is not None: # Note *slider.getRating*, not sliderfiller.getRating
print("A slider has a rating")
completed_ratings = completed_ratings + 1
if completed_ratings == 1:
print("Completed ratings is exactly 1, ending routine")
continueRoutine = False
That should convert to a bunch of console.log statements you can see in your browser’s JS console, and it will help you figure out exactly which pieces of this aren’t working as intended.