PennController for IBEX › Forums › Support › Accuracy for selector with a template and putting a "pause" between trials › Reply To: Accuracy for selector with a template and putting a "pause" between trials
Hi Lorrainy,
1) The command selector.test.selected
takes a reference to an element as its argument, not just the element’s name: https://doc.pcibex.net/selector/selector-test-selected/
Your code should be:
getSelector ("fraseT2") .test.selected( getText(row.acuracia) ) .success( getVar("acuracia").set(1) ) .failure( getVar("acuracia").set(0) )
(The next line .log("acuracia" , getVar("acuracia"))
has no effect, since you already call log
on that Selector element when you create it—you seem to be trying to use newTrial().log
here, so you should move that line on the closing parenthesis of newTrial
, which actually comes immediately on the next line in your code)
2) This rshuffle("tarefa2Alvo", "tarefa2Distratoras")
outputs a sequence of shuffled trials labeled tarefa2Alvo
or tarefa2Distratoras
, and adding ,"transiTarefa2"
just after it will simply run any trial labeled transiTarefa2
after that sequence
The function you are looking for is sepWith( separator , subsequence )
, in your case you want to use sepWith( "tarefa2Distratoras" , rshuffle("tarefa2Alvo","tarefa2Distratoras") )
3) In your code you first attempt to add a Button element named botao8 before
the Button element named botao7, but you reference that Button element (getButton("botao8")
) before you even create it, so nothing effectively gets added to the left of botoa7. Even if it did, you print
botao8 again just after that, so it will necessarily end up below botoa7, centered on the page
What you want is:
newButton("botao7", "Voltar") .callback(jump("pratica1"),end()) .before( newButton("botao8", "Seguir") ) .css("margin-left","1em") .print() , getButton("botao8").wait()
Jeremy