Howdy, Stranger!

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

Supported by

Item variables, behaviour of counters

edited May 2016 in OpenSesame

If a have a feedback item in a sequence with a run if condition, then the corresponding count variable (count_feedback) is incremented only when this condition is met.

If a have a sketchpad item (or an inline_script) in a sequence with a run if condition, then the corresponding count variable (count_sketchpad) is incremented each time the sequence is called, regardless of the condition.

This seems different from the documentation where it says: every item creates a count_[item name] variable, which reflects how often the item has been called.

Am I missing something? Is there a difference between running and calling an item.


Comments

  • edited 1:45AM

    Hi,

    Thanks for pointing this out. This is indeed inconsistent behavior, and it probably affects other items as well. Basically, what happens is that the counter is increased during the prepare phase of the sketchpad (and most other items), but during the run phase of the feedback item. Therefore, disabling item execution through a run-if statement, which disables only the run phase, causes the counter to stop incrementing only for the feedback item.

    So that's the cause. But I'll have to think a bit about the best, and most consistent way to improve this.

    Does this cause any problem in your experiment, or is it just a general question?

    Cheers!
    Sebastiaan

  • edited 1:45AM

    Hi Sebastiaan,

    Thanks for your explanation - at least we now know what is happening (and why). Wilberth actually posted this question on my behalf, as he has helped me a lot with solving programming issues in my experiment.

    It doesn’t cause really big problems, but I just wanted to include ERP trigger counters in my log file as a backup. If something would go wrong with the triggers in the EEG file, I would be able to see if a trigger was actually sent in the experiment.

    Is there any other way to do this? Currently I am already collecting data, but for the (near) future it would be helpful to have the trigger counters working.

    Thanks again,
    Johanna

  • edited 1:45AM

    Hi Johanna,

    Well, the easiest way is just to manually keep track of a counter. For example, you create a counter at the start of the experiment:

    var.my_counter = 0
    

    And then you increment the counter on every trial:

    var.my_counter += 1
    

    That way you have full control over the counter.

    Cheers!
    Sebastiaan

Sign In or Register to comment.