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

#5144
mg5171
Participant

To follow up on this, I have the following. The items have a column called ‘number’ and are labeled 1-90. This seems to be giving me the first 45 only, but in a randomized order (which is also probably because I’m randomizing with the Sequence command at the beginning. Any ideas why it’s giving me the first 45 instead of a random 45 out of the total 90?

//fillers

numberRows_fillers = 90; 
numberDraws_fillers = 45; 
randomIDs_fillers = [...new Array(numberRows_fillers)].map((v,i)=>i).sort(v=>Math.random()>0.5).splice(1,numberDraws_fillers); 

Template( defaultTable.filter( r => r.type=="filler" && randomIDs_fillers.indexOf(Number(r.number))>-1 ),
    variable =>