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

https://www.psychopy.org/recipes/builderFeedback.html

Generally speaking what you’re doing is the same as making a feedback trial, but instead of providing feedback you’re just taking the response and using it to fill in a stimulus. It should be fairly straightforward to use code components and either store the response to a separate variable, or actually access the data from the previous trial directly (the first link shows how to do this in Python, and the auto->JS translator in the code component can probably make it work the same way online as well).