psychopy.org | Reference | Downloads | Github

How to realize "continueRoutine = False" online


#1

Hi, I want to know… Can I realize " continueRoutine = False" online? I am not familiar with Javascript, so I don’t know how to convert this Python script into Js. thanks a lot !


#2

The syntax is the exact same in Js. For example, the Js code

if (theseKeys.length > 0) {  // at least one key was pressed
      // a response ends the routine
      continueRoutine = false;
    }

corresponds to the Python code

if len(theseKeys) > 0:  # at least one key was pressed
    # a response ends the routine 
    continueRoutine = False

(disclaimer: I haven’t tried to modify my own Js code yet so there might be other issues at play here, but it seemed like you just needed the syntax.)


#4

Thanks for your reply . But in my experiment , I use mouse ,not keyboard . How to do that ? I couldn’t run my experiment online successfully.:confounded:


#5

You could see my another post , mouse.isPressedIn()


#6

It looks like your problem is with the loop syntax, not with continueRoutine = False. I’ll share the loop syntax on your other post!