Howdy, Stranger!

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

Supported by

output variables not updated


I'm running an experiment where participants have to answer certain test questions. If some of their answers are incorrect, the test is repeated. Everything works fine, but when at the end of the test I'm trying to output the proportion of the correct answers to the participant ("You have [proportion] correct answers"), it shows the value from the PREVIOUS loop run. After the first run it will always be 0, on the second run it will be the value from the run etc. Meanwhile, in the logfile the variable is logged correctly, and all the conditionals that use the variable work correctly.

The relevant pieces look like that:

inline_script: define variable "ncorrect", set to 0 through exp.set


loop (repeats the test; break if ncorrect is maximum, breaks when it must)


inline_script: set ncorrect to 0, update through exp.set

loop (the test itself)


form (participant answers the question)

inline_script: checks whether the answer is correct; updates ncorrect through exp.set


sequence (test results)

inline_script: proportion = ncorrect/maximum, set proportion through exp.set

form_text_display: You have [proportion] correct answers (and it's here the number is wrong!)

OpenSesame version 3.2.7, backend legacy, all the inline_scripts are in the Run phase (I tried moving them to Prepare, but that doesn't help).

Tried searching the forum, but didn't find exactly the same problem.



  • Hi Sasha,

    My first guess is that you're showing this feedback using a sketchpad, which is prepared in advance and thus does not reflect up-to-date variables. If so, then you'll want to use a feedback item, which is not prepared in advance. Does that clear things up?

    See also:



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

  • Hi Sebastiaan,

    ah, yes, that does solve it, thanks very much!



Sign In or Register to comment.