Randomization of paired stimuli

If this is going to be online things get more difficult, mostly because you can’t load fresh condition files on the fly as easily (I know it’s possible in the most recent versions but I’m not very experienced with it). All the code will need to be in JavaScript as well, though the automatic code conversion should help with that, but ‘shuffle’ won’t work the same way (see the Python to Javascript cheat sheet).

In the code I wrote, rather than a list of stimulus pairs, I created a dictionary with separate lists for stimulus and go/no-go, and those lists were aligned. So a ‘pair’ would just be the same list index in the ‘img’ and ‘gonogo’ fields of the dictionary. It’s just a different way of achieving the same thing, but it had the primary advantage of being something you could turn into an Excel file so it could be used as a condition file and fed into the builder. So in the loop I used to add ‘img’ and ‘gonogo’ to B1Stim above, you would just have to add ‘t1_corrkey’ and ‘t2_corrkey’ as well.

Doing this in JS is going to be trickier. For the feedback part, you can look at some past entries on the forum, like this one: Display contingent feedback - #16 by emregurbuz

The randomization is trickier. You could try starting here: Setting order of stimuli conditionally - link generated order to condition file

Alternately, you could construct the orders in advance the same way as you do now, and then set the parameters for all the stimuli in some “Begin Routine” code, with extra code on a trial that appears between blocks to organize the order of blocks and shuffle the order within each block. Basically replace the functionality of the condition file with code. That’s a little involved and unfortunately not something I have time to put together a demonstration of right now.