How to dynamically generate stimuli based on subjs' prior responses?

I don’t have a perfect example offhand but there are two general ways I can think of doing this:

  1. Have both types in a normal trial loop with a safeguard. That is, have a code component in your “begin routine” tab that checks the list of old items and if there isn’t a valid option, moves things around in the loop’s trialList to replace it with a valid trial.
  2. Do everything with code components in the “begin routine” tab: First check if there are valid old responses, if so do a coin flip to see which type of trial to present, then select stimuli from the list of random words and the list of old words, or two stimuli from the list of random words.

This might also be useful: Randomly select two pictures of the three group of pictures without replacing

And this one has an example of something similar, though with an unrelated problem: Issue converting my Psychopy code component (that runs well locally) so that it is compatible online