Reply To: Catch Trials

PennController for IBEX Forums Support Catch Trials Reply To: Catch Trials


Hi Nickolas,

1) I suspect that the audio filenames might not be consistent across groups in your main CSV table, for example maybe you typed uppercase extensions in some rows—you should double-check that
The internal counter just keeps track of how many times your experiment was taken (since the last time you deleted the counter file, if you deleted it) but PennController (and Ibex, independently) cycle through it based on the number of groups in your design, eg. if you have 16 groups and a participant takes your experiment with counter 243, they’ll be assigned group 243%16=3

2) You should not use ShuffleInChunks as the argument of modifyRunningOrder, in fact you should not call modifyRunningOrder: Ibex calls it internally. What you can do is (re)define it, and it will be executed after the whole sequence has been computed (from the Sequence command in PennController, from the shuffleSequence variable in native Ibex).
PennController actually needs to define modifyRunningOrder, and this might cause conflicts with whatever you are trying to do. It’s better if you can avoid using the modifyRunningOrder method altogether. You can easily define your own function to insert an item ever N trials:

function SepWithN(sep, main, n) {
    this.args = [sep,main]; = function(arrays) {
        assert(arrays.length == 2, "Wrong number of arguments (or bad argument) to SepWithN");
        assert(parseInt(n) > 0, "N must be a positive number");
        let sep = arrays[0];
        let main = arrays[1];

        if (main.length <= 1)
            return main
        else {
            let newArray = [];
            while (main.length){
                for (let i = 0; i < n && main.length>0; i++)
                for (let j = 0; j < sep.length; ++j)
            return newArray;
function sepWithN(sep, main, n) { return new SepWithN(sep, main, n); }

Then, assuming you create a break trial labeled break, you can use it like this:

Sequence(sepWithN( "break" , shuffleInChunks("main",14,"catch",1) , 30))


  • This reply was modified 2 years, 5 months ago by Jeremy. Reason: replaced main.pop() with main.shift()