Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Variable does not exist

alperkumcualperkumcu Posts: 2
edited March 2017 in OpenSesame


I'm quite a noob with OpenSesame. So I apologise in advance if my question is redundant but I couldn't find a solution by checking the previous threads or the manuals.

I have a reaction time experiment with two tasks in the sequence: (1) Interference and (2) Retrieval. I want to present average reaction time after each task. As I have two tasks, I can't use the default [avg_rt]. Log file creates reaction time variables for both tasks individually. I can see the correct reaction times under these columns. Variable inspector shows them as well:

However, when I type these variable(s) as text in a sketchpad item as in the default Feedback example, the experiment terminates and I get the error message:

"The variable 'response_time_interference_response' does not exist" or "The variable 'response_time_retrieval_response' does not exist".

Do you have any idea why this happens and how to solve it?


1.PNG 12.7K


  • DahmSFDahmSF Posts: 92

    Dear alperkumcu,

    have you already tried to use the feedback item instead of a sketchpad item?


    Thanked by 1alperkumcu
  • I have the same problem! - don't understand what is going on there--

  • KnanteKnante Posts: 144

    Hi Alper and Mari,

    I'm not entirely sure, but it could be that the variables have not been defined globally (i.e. throughout the whole experiment) and OpenSesame is trying to initialize these variables. Would it help to add an inline script at the very beginning of your experiment where you would define the variables manually in the prepare phase:

    var.response_time_inteference_response = 0
    var.response_time_retrieval_response = 0


    Thanked by 1alperkumcu
  • eduardeduard Posts: 1,105

    Stephan is probably right. I think the issue is that the variables don't exist yet. In contrast to feedback items, sketchpads are defined during the prepare phase. At that time, the variables don't exist yet. If you use a feedback item it should work. Knante's suggestions is probably useful to make the experiment run, but I doubt that you would get sensible average response times from it.

    In any case, if this is not the issue, we will need more information, on your experimental structure, and the way your trying to present the feedback. Like that it is hard to tell what is going on with certainty.


    Thanked by 1alperkumcu
  • I managed to solve my problem with the exp.set("variable_name", variable_name) function - which exports my python variable into opensesame and makes it accessible to the sketchpad/ feedback items :).

  • I did run into another problem now, though, with a different variable - and my previous solution did not work. I am programming an operation span task, where participants are presented with a sequence of letters and at the end of the sequence they see a form with 12 letters which I present on a sketchpad item, and they have to select the letters they saw in sequential order.

    I managed to store the clicks in an array, and then I transform the array into a variable, however, when I try to display the sequence in the sketchpad by placing a variable name into it: [userLetterSequence], it says my variable does not exist. I tried defining it both at the beginning of the trial sequence and in the prepare phase of the inline script, and I tried to import it as an opensesame variable, but it still did not work.

    Would you know what is going on?



  • eduardeduard Posts: 1,105

    Hi Mariana,

    Could you upload your experiment? It's a little tedious trying to think what could be going wrong without seeing your code.



  • Thank you all for your comments and support.

    I haven't been able to check the comments for a while and sorry for my late comment. Indeed, I solved the problem by using feedback item. Shame that I haven't noticed it there before. As explained by Eduard, a sketchpad item shows the responses from the previous trial as new responses haven't been logged at the time of its presentation.


Sign In or Register to comment.