PennController for IBEX › Forums › Support › Accuracy for selector with a template and putting a "pause" between trials
Tagged: Selector; Pause trial; Template;
- This topic has 1 reply, 2 voices, and was last updated 3 years, 2 months ago by Jeremy.
-
AuthorPosts
-
October 3, 2021 at 8:46 pm #7340LorrainyParticipant
Hey, so I’m having some trouble finding the solution for this two:
1) I have an experiment in which I created a template to show some sentences and the participant should select where, in the sentence, is the suject. With that, I wanted to collect the accuracy of it’s answer and set 1 or 0 for it. In my table I set a column named “acuracia” where I put which is the column with the correct answer.
I did it for the task with a scale and it worked, however it’s not working for the selector command.
Here’s what I did:
getSelector ("fraseT2") .test.selected(row.acuracia) .success( getVar("acuracia").set(1) ) .failure( getVar("acuracia").set(0) ) .log("acuracia" , getVar("acuracia"))
2) The second thing that it’s not working is that I need to put a pause trial between each sentence that it’s being called from a template.
For example: In the sequence(), I have –>rshuffle("tarefa2Alvo", "tarefa2Distratoras"), "transiTarefa2",
The trial that should work as a pause it’s the “transiTarefa2” and it should appear between EACH sentence from the templates of “tarefa2Alvo” and “tarefa2Distratoras”. I saw something with a separator function, but it didn’t work (I don’t think I understood it well).
Oh, if it posible…
3) How can I put 2 buttons side by side? I tried using the .settings.before but it didn’t work how I wanted :/Here’s the link for my project: https://farm.pcibex.net/r/WzOKfG/
Thanks,
Lorrainy- This topic was modified 3 years, 2 months ago by Lorrainy.
October 4, 2021 at 11:14 am #7345JeremyKeymasterHi 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 calllog
on that Selector element when you create it—you seem to be trying to usenewTrial().log
here, so you should move that line on the closing parenthesis ofnewTrial
, which actually comes immediately on the next line in your code)2) This
rshuffle("tarefa2Alvo", "tarefa2Distratoras")
outputs a sequence of shuffled trials labeledtarefa2Alvo
ortarefa2Distratoras
, and adding,"transiTarefa2"
just after it will simply run any trial labeledtransiTarefa2
after that sequenceThe function you are looking for is
sepWith( separator , subsequence )
, in your case you want to usesepWith( "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, youprint
botao8 again just after that, so it will necessarily end up below botoa7, centered on the pageWhat you want is:
newButton("botao7", "Voltar") .callback(jump("pratica1"),end()) .before( newButton("botao8", "Seguir") ) .css("margin-left","1em") .print() , getButton("botao8").wait()
Jeremy
-
AuthorPosts
- You must be logged in to reply to this topic.