I have created an experiment where participants type in answers to simple math problems. They do this for 20 trials, then their average reaction time is multiplied by .95 and used as the end time for the next set of math problem routines. Participants see the math problems, type in their answers, see a feedback screen with their answer and the correct answer, and then repeat. The math problem and the feedback are two different routines.

As per usual, this runs fine locally. When I try to run it in pilot mode on Pavlovia, it works as planned for the first set of untimed trials. When the timed trials start to run, it only shows some of the math problems, but shows the feedback for all iterations of the loop. So to a participant, it looks like they do a math problem, see feedback, then see new feedback (with their answer blank, since they never saw a problem to answer).

I am struggling to figure out why this is happening. It seems to be random which ones are shown - I have a line of code in ‘Begin Routine’ grabbing the current time and writing it to the dataset, and then in ‘Every Frame’ it grabs the time at the end of the routine and writes that. The datasets from a few iterations of the experiment show that it is skipping routines at random, but it does appear to “start” the routine since the current time at the end gets written as a 0 for those skipped instances.

What is particularly odd, to me, is that this works perfectly on the routines without the timing code. I thought that the problem must be in the timing code, but if I comment it out, then I get a new error about undefined properties, and I feel stuck in a loop of errors that I can’t decipher.

Below is the flow of the section that doesn’t work and the code.

Begin Routine:

```
#create random numbers for the math problem
numOne = randint(1,10)
numTwo = randint(1,10)
numThree = randint(1,10)
numFour = randint(1,10)
corrResp = numOne + numTwo + numThree + numFour
textFill = ''
timer.reset() #timer is timer = core.Clock() in Begin Experiment
numList = [numOne, numTwo, numThree, numFour]
expTime = timer.getTime() #this was for my debugging purposes
```

Each Frame

```
t = timer.getTime()
if t >= newTime: #newTime is created in an earlier routine and I can see that it is written correctly because it appears properly in the data on these trials
continueRoutine = False
expTime = t #for debugging purposes - expTime gets written to the data
```

My experiment is in pilot mode because I do not yet have credits, so I am not sure if I can post the URL for it. I can upload the file for the experiment, if necessary.