psychopy.org | Reference | Downloads | Github

Feedback code component 'syntax error'

I am running PsyhcoPy 2020, windows 10. I have a routine for presenting an audio stimulus, followed by a routine for providing feedback on whether the participant is correct and their response time:

However, the code component inidcates a syntax error:

I’ve copied this code from when i ran this experiment in a previous version of PsychoPy, and originally adapted it from a forum, possibly this one. I am new to Python though, so I’m not really sure where the syntax error is?

You can’t use that form of string formatting if you want the auto translate to work. You need to use

msg="Correct! Response Time = "+str(round(PresentStimkey.rt,3))

were you have previously defined round in code_JS as per my crib sheet (see pinned post in online)

If you don’t want to use the experiment online you can ignore the Javascript syntax error.

1 Like