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.