Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Display experiment progress

I am programming an experiment in OpenSesame and I want the progress that a person has done in it to be displayed in the bottom right corner as a percentage.

I am calculating the percentage with an inline script in this way:

and then displaying the progress in the two canvases in those two ways (one is OpenSesame's fixation_canvas object and the other one is an inline script):

However, when I run the experiment, the text remains "Progress: 0%" the entire time and the number doesn't change to reflect the actual progress. What is it that I'm doing wrong?

Comments

  • Hi Nick,

    You're running into a weird property of Python 2 (but not Python 3), which is that integer divisions always return int values (and the decimals are discarded). In other words: 5 / 10 == 0

    To avoid this, you can add a float somewhere in the equation, such as 1. (the point indicating that it's a float and not an int) . Like so: 1. * 5 / 10 == 0.5

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.