There are a number of ways to do that, I personally prefer using <list> elements:
* Pick 4 items at random onexptbegin and store item numbers in list.chosenitemslist *
<expt>
/ onexptbegin = [list.chosenitemslist.setitem(list.allitemslist.nextvalue, 1);
list.chosenitemslist.setitem(list.allitemslist.nextvalue, 2);
list.chosenitemslist.setitem(list.allitemslist.nextvalue, 3);
list.chosenitemslist.setitem(list.allitemslist.nextvalue, 4);
]
/ blocks = [1=a; 2=b]
</expt>
<block a>
/ trials = [1-4=mytrial]
</block>
<block b>
/ trials = [1-4=mytrial]
</block>
<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>
* Stimulus Elements *
<text mytext>
/ items = myitems
/ select = list.chosenitemslist.nextvalue
</text>
* 8 Items *
<item myitems>
/ 1 = "A"
/ 2 = "B"
/ 3 = "C"
/ 4 = "D"
/ 5 = "E"
/ 6 = "F"
/ 7 = "G"
/ 8 = "H"
</item>
* List Elements *
* Item numbers for the 8 potential stims *
* At the start of the experiment, 4 item numbers will be drawn from this list *
* and stored in list.chosenitemslist for use throughout the rest of the experiment *
<list allitemslist>
/ items = (1,2,3,4,5,6,7,8)
/ selectionmode = random
/ replace = false
/ selectionrate = always
</list>
* Item numbers will be replaced onexptbegin *
<list chosenitemslist>
/ items = (1,1,1,1)
/ selectionmode = random
/ replace = false
/ selectionrate = trial
</list>