Trials progress in Pavlovia is not working for me

Hi everyone!

I am relatively new to PsychopPy and Pavlovia, and I would appreciate help with my problem.
I have a simple experiment with 40 trials, in each trial a participant listens to a short audio file and evaluates politeness of the frase by clicking a “Likert-scale” slider.

My participants are second language students and in order to keep them motivated I really need to show them a progress bar or a trials counter (how many phrases are there remaining).

Since I can’t code in Python yet and only use Builder, I found a ready-made solution in the exercises to the book “Building Experiments in PsychoPy” by Jonathan Peirce and
Michael MacAskill. The answer to exercize 6.2 “showProgress” proposes the following:

Begin experiment
progressMsg = “”
Begin routine
progressMsg = “{}/{}”.format(currentLoop.thisN, currentLoop.nTotal)

This solution works perfectly locally but does not work online in Pavlovia. I guess the reason is here (please see the image attached below).

Could anyone help me make it work in Pavlovia? Probably the book has the answer, but I haven’t had the time to read it, and the experiment is a bit urgent.
I would be deeply grateful, and sorry once again for the naive question.

Kindest regards,

Edited: Here’s the link to the experiment: polite_russian [PsychoPy]
It is in Russian, but just always press spacebar to proceed

Hi there!

This demo should do what you want :slight_smile:

For context, you did this exactly right to work locally but currently there are a couple of issues preventing this running online:

  1. python formatted string translation: the .format method doesn’t translate smoothly at present - so we use the ‘+’ method when getting online.
  2. thisN does not exist in JS.

Hope this helps,

1 Like

Hi Becca!

Thanks for your precious help!
I managed to create a simpler version of the same thing after spending a few hours during the weekend. I see now that I needed to use str() instead of format() and create a workaround for thisN.

Thank you for your code, I’m sure it will help other confused novices like me in the future.


Hi Pavel,

Happy to hear that you managed to find a solution!!