Millisecond Forums

How to randomize (truly random)

https://forums.millisecond.com/Topic17560.aspx

By nashby - 10/31/2015

So I know I can have every other subject do a series of tasks. But I dont want that. I want it to be random for each participant that they either go through one block or another, and there are four blocks like that in my task. So for example, I thought I could do a branch. It calls blockdsl, and then from there determines what block is ran. This works, but only for the first block encountered ( i.e., blockdsl, blockdss, blockssl, blocss)  after the block it branches to concludes it skips to the last block in the experiment (end). How can I get it to go through back to the next block in the expt?

Excerpt of code:

<block blockdsl>
/ branch = [if(values.side3 < = 50) {block.blockdsl1}{block.blockdsl2}]
</block>

<block blockdsl1>
/ trials = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65 = d1; 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66 = sn1; 67 = choice; 68 = forward; 69 = fixation;]
</block>

<block blockdsl2>
/ trials = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65 = sn1; 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66 = d1; 67 = choice; 68 = forward; 69 = fixation;]
</block>


<expt main>
/ blocks = [1 = instructions; 2 = taskinstructions; 3-6 = noreplace (blockss, blocksr, blockt, blockd); 7- 10 = noreplace(blockdss, blocktss, blockdsl, blocktsl); 11 = end;]
</expt>
By Dave - 11/1/2015

<expt>
/ blocks = [1-2=noreplace(a,b)]
</expt>

<block a>
/ branch = [if(list.ablocks.unselectedcount>0) list.ablocks.nextvalue]
</block>

<list ablocks>
/ items = (block.a1, block.a2)
</list>

<block a1>
/ trials = [1=mytrial]
/ branch = [block.a]
</block>

<block a2>
/ trials = [1=mytrial]
/ branch = [block.a]
</block>

<block b>
/ branch = [if(list.bblocks.unselectedcount>0) list.bblocks.nextvalue]
</block>

<list bblocks>
/ items = (block.b1, block.b2)
</list>

<block b1>
/ trials = [1=mytrial]
/ branch = [block.b]
</block>

<block b2>
/ trials = [1=mytrial]
/ branch = [block.b]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%script.currentblock%>")
</text>