Accuracy for selector with a template and putting a "pause" between trials

PennController for IBEX Forums Support Accuracy for selector with a template and putting a "pause" between trials

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #7340

    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")
                .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 –>


    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:


    • This topic was modified 2 years, 8 months ago by Lorrainy.

    Hi Lorrainy,

    1) The command selector.test.selected takes a reference to an element as its argument, not just the element’s name:

    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")
        .before( newButton("botao8", "Seguir") ) 


Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.