Code not working on pavlovia

Hello everyone,

I have recently begun using PsychoPy and I have been trying to solve this problem for a while. I thought it might be nice to get ideas from others, any help or suggestion is very appreciated. Sorry for the long post. :innocent:

URL of experiment: BoRec [PsychoPy]

Description of the problem: The code and experiments work perfectly locally, however, when I upload to Pavlovia instead of showing an image in every four trials (a star image to keep younger participants interested), it appears before every stimulus.

I created two pseudorandom lists of actual stimulus and I want to show the star image after every four trials without interrupting the sequential order of the randomized lists. I tried to manipulate the opacity of the slider and images but I encountered the error mentioned in Unable to set specific duration for specific stimuli [Unable to set specific duration for specific stimuli].

Here, I created a code* to check the trial number with help of a colleague. So, the star image routine would appear only after thisN trials. However, as I said it does not work as same as it works locally on PsychoPy and it does not give an error either.

*Code:

if bodytrial.thisN == 4 or bodytrial.thisN==8 or bodytrial.thisN == 12 or bodytrial.thisN == 16:
    StarCheckLoop = 1
else: 
    StarCheckLoop=0

Also, I tried to use the crib sheet to prevent any script errors https://docs.google.com/document/d/13jp0QAqQeFlYSjeZS0fDInvgaDzBXjGQNe4VNKbbNHQ/edit however, it crashed and didn’t upload at all.

Finally, I also tried to use the time condition parameter to manipulate when the slider and actual stimulus would appear and when the star would appear. However, this makes the experiment stuck in initializing the experiment part and I couldn’t find the solution for this one either -this one was more complicated tbh-.

Thank you so much for any feedback or suggestions, sorry for the long post again.

Best wishes,
Özge.

doesn’t work online.

Hi wakecarter,

Thank you for your reply. Do you have any idea how to overcome this issue without using thisN?

Best,
Özge.

Yes. Use a loop counter variable as per my crib sheet.

1 Like

Thanks a lot! That works perfectly!!