I set up a 1-back working memory task in the builder, and am trying to figure out the best way to randomize thought probes into the trials.
I currently have a routine, PracTrials, set up to pull from an excel sheet with columns $Trials and $CorrectResp along with a sequential loop, prac_loop, nReps $1. I also have two thought probes I’ve made into routines (TP1 & TP2), one with a slider component and the other with a textbox.
My question is: how do I interrupt PracTrials/prac_loop to randomly present TP1 or TP2 before going back to PracTrials? I’ve seen similar questions asked on the forum, and the response that got me closest to what I’m looking for involved a code component using an if statement like so:
if prac_loop.thisN in [7,21]
continueRoutine = False
so based off that I’m assuming that rather than stopping the loop at index 7 and 21, I need a code component to stop prac_loop randomly to display TP1 or TP2 (or if easier I have no problem setting TP to a fixed trial) before kicking back to PracTrial.
I’m more familiar with R than Python so I can follow concepts well enough, I’m just unfamiliar with specific syntax. Any advice on how to complete the above or suggestions on a cleaner flow would be very appreciated, thanks so much!