Reply To: Choosing subet of items to present

PennController for IBEX Forums Support Choosing subet of items to present Reply To: Choosing subet of items to present

#5862
samsanto
Participant

Hi Jeremy,

Thanks so much! This works pretty much how I need, I did have to switch around a couple things. Mainly I want all the “Train” to go first in a block then all the “Test” so I took out the rshuffle(…) but that was easy.

Now I’m having a problem where I want to do slightly different key presses depending on if its a “train” or “test.” For the train words, I just display the word, for the test words, I ask want to get user input. Based on how we set it up, each block is (hopefully) guaranteed to have 12 words in it so I am keeping a global counter variable that just switches off every 12 words the action (see below). However, this isn’t working. The counter is not actually incrementing and it is stuck on the “failure” option, any idea why?

Also if you have a better way to implement this, let me know (I feel like its too “hardcoded” if you know what I mean…)
Thank you for the continued help, I really appreciate it!!


PennController.Sequence(
    "Learn-0","Test-0","pause",
    "Learn-1","Test-1","pause",
    "Learn-2","Test-2","pause",
    "Learn-3","Test-3","pause",
    "Learn-4","Test-4","pause",
    "Learn-5","Test-5","pause",
    "Learn-6","Test-6","pause",
    "Learn-7","Test-7","pause",
    "Learn-8","Test-8","pause",
    "Learn-9","Test-9","pause",
    "Learn-10","Test-10","pause",
    "Learn-11","Test-11","pause"
);
PennController.ResetPrefix(null);

newVar("count")
    .set(0)
    .global()
;

PennController("pause", newButton("Take a break").print().wait() );

PennController.Template( "statTableRandom.csv" , row =>
    newTrial( addItem(row.Type) ,
    
        getVar("count").test.is(12)
            .success(
                getVar("count").set(0)
                ,
                newText(row.Word).print()
                ,
                newKey("yn").wait()
            )
            .failure(
                getVar("count").set(v=>v+1)
                ,
                newText(row.Word).print()
                ,
                newKey(" ").wait()
            )
    )
);

-Sam