+x+x(Sorry, it's really hard to post a reply to in this forum)
Thank you, I'll try this approach.
I actually have 6 different blocks that I want to counterbalance. Will I have to create a new <exp> for each possibility (probably infeasible given the number of possible combinations), or is there a way around this?
Thanks!
"Counterbalancing" (the word you used) means what you want to do is systematic, i.e. the order is an (implicit at least) between-subjects condition. If that's the way you want to treat this, then yes, you need to create the requisite amount of <expt>s (i.e. between-subjects conditions). If you merely want to randomize groups of blocks, then there may be another way, but you'd have to be way more specific about what exactly it is you want to do.
Here's a quick example how you can randomize groups of blocks by setting up one dummy block per group, sampling those dummy blocks in random order per the /blocks attribute, and then use <list> elements to run the actual blocks within each group.
<values>
/ n_blocks_in_group = 0
/ in_group_count = 0;
</values>
// randomize the order of the three groups of blocks
<expt>
/ blocks = [1-3 = noreplace(group1, group2, group3)]
</expt>
// dummy block initiating the execution of the group 1 blocks
<block group1>
/ onblockbegin = [
values.n_blocks_in_group = list.group1_blocks.itemcount;
values.in_group_count = 0;
]
/ branch = [
list.group1_blocks.nextvalue;
]
</block>
// dummy block initiating the execution of the group 2 blocks
<block group2>
/ onblockbegin = [
values.n_blocks_in_group = list.group2_blocks.itemcount;
values.in_group_count = 0;
]
/ branch = [
list.group2_blocks.nextvalue;
]
</block>
// dummy block initiating the execution of the group 3 blocks
<block group3>
/ onblockbegin = [
values.n_blocks_in_group = list.group3_blocks.itemcount;
values.in_group_count = 0;
]
/ branch = [
list.group3_blocks.nextvalue;
]
</block>
// three blocks A to C in group 1
<list group1_blocks>
/ items = (block.group1_a, block.group1_b, block.group1_c)
</list>
<block group1_a>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group1_blocks.nextvalue;
}
]
</block>
<block group1_b>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group1_blocks.nextvalue;
}
]
</block>
<block group1_c>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group1_blocks.nextvalue;
}
]
</block>
// two blocks A to B in group 2
<list group2_blocks>
/ items = (block.group2_a, block.group2_b)
</list>
<block group2_a>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group2_blocks.nextvalue;
}
]
</block>
<block group2_b>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group2_blocks.nextvalue;
}
]
</block>
// four blocks A to D in group 3
<list group3_blocks>
/ items = (block.group3_a, block.group3_b, block.group3_c, block.group3_d)
</list>
<block group3_a>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group3_blocks.nextvalue;
}
]
</block>
<block group3_b>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group3_blocks.nextvalue;
}
]
</block>
<block group3_c>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group3_blocks.nextvalue;
}
]
</block>
<block group3_d>
/ onblockbegin = [
values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
if (values.in_group_count < values.n_blocks_in_group) {
list.group3_blocks.nextvalue;
}
]
</block>
<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>
<text mytext>
/ items = ("This is block <%script.currentblock%>. ~nIt is block number <%values.in_group_count%> in a group of <%values.n_blocks_in_group%> blocks.")
/ size = (75%, 30%)
</text>