Skipping trials logic not working properly

PennController for IBEX Forums Support Skipping trials logic not working properly

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10433
    Pemberton
    Participant

    Hi Jeremy,

    In my experiment, I wanted to first offer some control tasks for people, and if they managed them with no more than 2 mistakes, then let them into the actual experiment. However, I am unable to do so consistently for some reason.

    I am using “correct” variable to track the number of correct responses, which is initialized as

    newVar("correct", 0).global(),

    The code I am using for evaluating the number of correct answers is

    newKey("answerTrain", "YN").log().wait()
         .test.pressed("N")
            .success(getVar("correct").set(v=>v+1)),

    And then, in the trials, I use

    getVar("correct").test.is(/[789]/).failure(end()),

    And once they are done, I provide them with either a correct code or a code that signals they haven’t completed the experiment well (using the same code as above).

    Sometimes it works as intended, other times it doesn’t, and I am not able to figure out why. The idea seems to be good in theory, but the practice proves otherwise. The link to my project is https://farm.pcibex.net/r/XMvnEu/

    Thanks in advance!

    #10434
    Jeremy
    Keymaster

    Hi,

    The value of your Var element is numeric, it’s not a string, so I don’t expect the regular expression to test the value

    If you want to test if the value is comprised between 7 and 9 included, use a function instead: getVar("correct").test.is(v=>v>6&&v<10)

    Jeremy

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