Howdy, Stranger!

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

Supported by

Variable does not exist

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


  • Dear alperkumcu,

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


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

  • 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


  • 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.


  • 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?



  • 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.


  • Hi Laurent,

    I had written the variable in the inline script in the way you mentioned.But after the experiment the average time,accuracy comes out to be zero.
    Can you suggest any way so that I can get the value of average time ,accuracy.
    I am pretty sure it comes zero because in the script it is zero.In place of zero what I can write?

  • Hi,

    Could you provide more detail on what you actually did? Either by posting the experimental structure and the code you use, or by uploading your experiment?


  • Hi everybody,

    I have a similar problem. I designed a reaction time experiment using sentence stimuli. Therefore I used a former experiment which has the same structure and copy-pasted the new sentence stimuli in the experiment. However, the error message "the variable context_sentence does not exist" occured so I checked the variable inspector and it's listed in there.

    Can someone help? Do I have to write an inline skript? I'm a total newbie on Opensesame so I apologize!

  • Hi Sophie,

    Can you share your experiment? I suspect the variable is somewhere in the unused items which would make it appear in the variable inspector, but not in the actual experiment. Anyway, with your experiment, I will be able to tell with certainty what is going on.


Sign In or Register to comment.