OS (e.g. Win10): Mac Sonoma 14
PsychoPy version (e.g. 1.84.x): v2023.1.3
Standard Standalone? (y/n) If not then what?: y
This is how the data looks after running locally on Psychopy:
000745_RL_Task_cost_2023-11-06_16h43.03.248.csv (24.9 KB)
What are you trying to achieve?:
I am trying to get the exact timing for keypresses in my task. Three tones will be played and the participants should press the correct key at the same time with the 3rd tone. They will get feedback on whether they were “too early” or “too late” or “on time” and then they will gain points if they got the trials correct and on time.
What did you try to make it work?:
I added a code snippet to my builder and the following code is my “each frame” tab – my colleague suggested using tThisFlipGlobal function as it worked for her similar task:
if rightleft_choice_training.keys: keyToneDiff = 1.2-t keypressTime = tThisFlipGlobal keyPressed = rightleft_choice_training.keys rightleft_choice_training.keys =  rightleft_choice_training.status = FINISHED continueTxt.status = FINISHED continueKey.status = FINISHED if keyPressed == CorrResp: trialCorrect = 1 else: trialCorrect = 0 if keyToneDiff >= (0.1+frameTolerance): feedbackTxt = "Too soon!" timeFeedback.setAutoDraw(True) timeFeedback.status == STARTED timeFeedback.tStartRefresh = tThisFlipGlobal elif keyToneDiff <= (-0.1-frameTolerance): feedbackTxt = "Too late!" timeFeedback.setAutoDraw(True) timeFeedback.status == STARTED timeFeedback.tStartRefresh = tThisFlipGlobal else: feedbackTxt = "On time!" timeFeedback.color = "red" timeFeedback.setAutoDraw(True) timeFeedback.status == STARTED timeFeedback.tStartRefresh = tThisFlipGlobal if trialCorrect == 1: correctReps = 1 points = points + 95 else: incorrectReps = 1 points = points - 5
What specifically went wrong when you tried that?:
The code works locally and I get the timing right in my output data and the task runs smoothly on psychopy. However, when trying to push to Pavlovia, I get error message that tThisFlipGlobal is not defined and the task doesn’t even start.
This is my git folder for the task (IMPORTANT: please check RL_Task_cost not the old one https://gitlab.pavlovia.org/Parnianrafei/rl_task
I also read wakefield’s cribsheet which is very useful but still couldn’t find a solution.
I would be more than grateful if you could help me with this!
Include pasted full error message if possible. “That didn’t work” is not enough information.