+x+xOh no, sorry about that! Thanks for asking.
There are 6 words which each have 3 different meanings or images associated with them (for example, one trial would have a picture of drinking glasses, another trial that would show a picture of reading glasses, and a third trial that would have a picture of goggles-- together, the three of these form a "glasses" category). So I was trying to describe the three trials together as a trial type.
And we want all three of these trials to either appear with one set of three audio stimuli or all three appear with another three audio stimuli (this reflects the condition assignment) and we want the word/trial type to be randomly selected for a given participant and we want the condition to be randomly selected, but we want to be sure the participants get the same number of trials in each condition and we never want to split trial types across conditions (so if one of the three glasses trials appears in condition A, none of the other two glasses trials can appear in condition B)-- and we have to have order completely randomized.
Are we better off just hard coding pseudo-randomizations?
Could you please spell out which <trial> elements belong together and refer to those trial elements exactly as you named them in the script? I don't have your image files, the code appears otherwise incomplete (there are no <block condition2> and <block condition3> elements, although they are referenced in your <expt> element), and it's still not clear to me what the condition assignment is supposed to be.
You mention sets of three audio stimuli, yet I cannot find any audio stimuli referenced anywhere in the code.
Okay, let me try to tackle this schematically. Suppose you have six "types" A to F (or 1 to 6 in numerical terms), with each type made up of three separated <trial> elements. That is
Type A = <trial a1>, <trial a2>, and <trial a3>
Type B = <trial b1>, <trial b2>, and <trial b3>
...
Type F = <trial f1>, <trial f2>, and <trial f3>
You want to distribute the types across two blocks of 9 trials each.
So, block1 might run trials b1, b2, b3, e1, e2, e3, f1, f2, and f3 in random order; that is types B, E, and F. The 2nd block, then, would necessarily run trials a1, a2, a3, c1, c2, c3, d1, d2, and d3 (also all in random order), that is: the remaining types A, C, and D.
The way to pull this would be by populating separate <list> elements for each block with randomly selected type numbers at the beginning of the experiment (/onexptbegin), like so:
// we select three types per block and fill per-block condition lists accordingly
<expt>
/ onexptbegin = [
list.cond1types.appenditem(list.typelist.nextvalue);
list.cond1types.appenditem(list.typelist.currentvalue);
list.cond1types.appenditem(list.typelist.currentvalue);
list.cond1types.appenditem(list.typelist.nextvalue);
list.cond1types.appenditem(list.typelist.currentvalue);
list.cond1types.appenditem(list.typelist.currentvalue);
list.cond1types.appenditem(list.typelist.nextvalue);
list.cond1types.appenditem(list.typelist.currentvalue);
list.cond1types.appenditem(list.typelist.currentvalue);
list.cond2types.appenditem(list.typelist.nextvalue);
list.cond2types.appenditem(list.typelist.currentvalue);
list.cond2types.appenditem(list.typelist.currentvalue);
list.cond2types.appenditem(list.typelist.nextvalue);
list.cond2types.appenditem(list.typelist.currentvalue);
list.cond2types.appenditem(list.typelist.currentvalue);
list.cond2types.appenditem(list.typelist.nextvalue);
list.cond2types.appenditem(list.typelist.currentvalue);
list.cond2types.appenditem(list.typelist.currentvalue);
]
/ blocks = [1=block1; 2=block2]
</expt>
<block block1>
/ preinstructions = (pg1)
/ trials = [1-9 = list.block1trials]
</block>
<block block2>
/ preinstructions = (pg2)
/ trials = [1-9 = list.block2trials]
</block>
// we have six types A to F
// A = 1
// B = 2
// ...
// F = 6
// we'll select 3 types at random for each of the two blocks
<list typelist>
/ items = (1,2,3,4,5,6)
/ selectionrate = always
</list>
// types for the two blocks are selected onexptbegin
<list cond1types>
</list>
<list cond2types>
</list>
<list block1trials>
/ items = (list.type_a.nextvalue, list.type_b.nextvalue, list.type_c.nextvalue, list.type_d.nextvalue, list.type_e.nextvalue, list.type_f.nextvalue)
/ select = list.cond1types.nextvalue
</list>
<list block2trials>
/ items = (list.type_a.nextvalue, list.type_b.nextvalue, list.type_c.nextvalue, list.type_d.nextvalue, list.type_e.nextvalue, list.type_f.nextvalue)
/ select = list.cond2types.nextvalue
</list>
//Type A
<list type_a>
/ items = (trial.a1, trial.a2, trial.a3)
</list>
<trial a1>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial a2>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial a3>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
//Type B
<list type_b>
/ items = (trial.b1, trial.b2, trial.b3)
</list>
<trial b1>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial b2>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial b3>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
//Type C
<list type_c>
/ items = (trial.c1, trial.c2, trial.c3)
</list>
<trial c1>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial c2>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial c3>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
//Type D
<list type_d>
/ items = (trial.d1, trial.d2, trial.d3)
</list>
<trial d1>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial d2>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial d3>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
//Type E
<list type_e>
/ items = (trial.e1, trial.e2, trial.e3)
</list>
<trial e1>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial e2>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial e3>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
//Type F
<list type_f>
/ items = (trial.f1, trial.f2, trial.f3)
</list>
<trial f1>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial f2>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
<trial f3>
/ stimulusframes = [1=mytext]
/ validresponse = (0)
/ trialduration = 1000
</trial>
// the unimportant stuff
<text mytext>
/ items = ("<%script.currenttrial%>")
</text>
<page pg1>
^This is the 1st block of 9 trials.
</page>
<page pg2>
^This is the 2nd block of 9 trials.
</page>
<data>
/ separatefiles = true
</data>