Reply To: Setting accuracy and RT thresholds for practice block

PennController for IBEX Forums Support Setting accuracy and RT thresholds for practice block Reply To: Setting accuracy and RT thresholds for practice block

#6053
agnesgao
Participant

Hi Jeremy,

Thank you so much for the help! I think this is a great solution to my issue! I have another question: there is a second task following the first key press (sorry i should have mentioned it in my first post), and it doesn’t have ACC or RT limit. For some reason, the modified script skipped the second question automatically to the next trial even when the first key press didn’t exceed the RT time window. I tried using test.is on the var RT but it’s not doing anything and still skipping. The goal is: if the RT is over 2 sec, then it times out and moved on to the next trial; if it’s under 2 sec, then they complete the second question (coded as “pred”). Please see the partial relevant code below:

 newTimer("timewindow", row.Time )
        .start()
        .wait()
        ,
        newKey("LD", "ZM")
        .log("")
        .callback( getTimer("timewindow")
        .stop()
        ,
                
        getVar("RT")
        .set( v => Date.now() - v ) // finish measuring RT
        .log("first")
        .test.is( v => v<= 2000 )
        .success( getText("pred").print() )
        .failure(newText("failure", "Too slow...please respond faster").print() )
        ,
        
        getKey("LD")
        .disable()
        .test.pressed(row.correct)
        .success(  getVar("responses").set(v=>[true,...v]) )
        .failure(  getVar("responses").set(v=>[false,...v]) )

        ,
        
        newTimer("wait", 500) 
         .start()
         .wait()
         ,
        
        getText("fix2")//remove 
        .remove()
        ,
        
        newText("pred","Did you predict the word?")
        .print()
        .log()

        ,
        newKey("answer", "ZM")
        .wait() // This waits for a key press
        .log("first")

Thank you again for your help and patience!

Best,
Agnes

  • This reply was modified 3 years, 8 months ago by agnesgao.
  • This reply was modified 3 years, 8 months ago by agnesgao.
  • This reply was modified 3 years, 8 months ago by agnesgao.