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

#4892
Jeremy
Keymaster

Hi Maddie

1. I can see a couple ways to do this, but you’ll need some plain javascript anyway. Here’s a suggestion, assuming you have an Item column in your table that goes from 0 to, say, 100 for your filler items:

numberRows = 100;
numberDraws = 50;
randomIDs = [...new Array(numberRows)].map((v,i)=>i).sort(v=>Math.random()>0.5).splice(0,numberDraws);

Template( defaultTable.filter( r => r.type=="filler" && randomIDs.indexOf(Number(r.Item))>-1 ),
  variable => newTrial(
    // ...

2. I think what you are looking for is anyOf, you can use it like this: Sequence( "intro" , randomize(anyOf("experiment","filler")) )