Howdy, Stranger!

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

Supported by

Display variable in sketchpad

Hi, I am creating an experiment and I am new to Open sesame. I want to display a variable on a sketchpad whose value depends on the participant's response. I use an inline script to set an initial value of the variable using exp.set("my variable",999) in the beginning of the experiment and then I update this variable in the in an inline script in a loop later in the experiment using conditional statements of this kind- if self.get('response1') ==0: exp.set("my variable", self.get('response1')) where response1 is the defined form var for a multiple choice question. The problem is that the sketchpad still displays the original value 999 of the variable and doesn't update it based on the redefined value in the loop (which is dependent on the participant's response). I guess this is because the sketchpad only looks at the prepare section of the inline script before running and the variable can only be replaced in the run section. What should I do?


Sign In or Register to comment.