Random selection of learning condition within a loop

OS Windows 11:
PsychoPy version 2021.2.3:

Background: The experiment is testing two learning conditions to see which produces better recall in learning ASL signs. Participants watch the video of a sign twice and then should be randomly assigned a learning conditions. Either, making the sign they just saw or watching the sign again for a third time AND if “watch again” is selected, playing that same video for a third time. There are 80 videos in total set in a loop.

Problem/Question: How do I get psychopy builder to randomly choose the learning condition and if the “watch again” condition is chosen, play the video participants have just seen, again. I have tried all sorts of code inserts, nested loops, using multple csv/xlsx files, and I cannot seem to get it to work. Any help would be greatly appreciated!


Could you set nReps = randint(2,4) and then put nReps as the number of repetitions of the video loop.

Then, have a routine (e.g. called makeSign) with the following in Begin Routine

if nReps == 3:
     continueRoutine = False