Experiment uploaded to Pavlovia has brief black spots and after-images from previous trials

URL of experiment: Here

Description of the problem:

This experiment is built to test a method for measuring a length estimation based on a moving image.

  • Participants see a square that is either stationary or moving sinusoidally from left to right
  • They are then shown a much smaller rectangle (height is constant) that will start to ‘grow’ once the space bar is pressed.
  • Once the space bar is pressed, a new routine with a smaller square is shown that adjusts horizontally in size at a rate of (.001*(t*5),0).
  • In builder, everything works as expected and no phantom trials show up!
  • In deployment on Pavlovia, there is a large black screen before the grow trial begins.
  • Once the grow trial starts, if I let the square grow to 100px, on the next trial there is a brief moment where the 100px is visible.

What have I tried?

  1. I have tried included code in the End Routine tab which would reset the size back to .001. This ends up causing the trial to only ever show the static rectangle
  2. I have tried adding the reset width to a code component tied to a button press, but the same issue persisted.

I use a Pavlovia on a credit system, so if you end the experiment before 5 trials are up there should be no credit consumed.

I thank you for your time!

Hey!

Could you share your gitlab experiment with me so I can take a peek? My username is tpronk

Best, Thomas

Hey Thomas!

I just added you to the experiment, thank you!

I think I found a fix. As you observed, at the first frame the growing square is shown with the size of whatever it was last (some default size at the first trial, last width at later trials). I could fix it by adding a code snippet in your code component, Begin Routine tab, that sets it to the same width as the square in the Sq_Show routine:
sq.setSize([0.001, 0.1]);

2 Likes

BTW, is it OK if I make my clone of your experiment public? Then I can easily link to it in a bug report.

Please do, that is fine with me!

Awesome, thank you for this. I will test it out ASAP!

Edit: Just tested it out and it works perfectly!

Thank you so much! :slight_smile:

Thanks! Give a shout if this fixes your problem; then I can mark my post as a solution

This thread has been a life saver! I have had similar issues where previous positions or previous images flash in the first frame. Thomas’s response inspired me to see check my code, and using setPos and setImage in the begin Routine section of my code component has fixed my animation issues. A solution I never thought of. Thanks Thomas!

1 Like