Howdy, Stranger!

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

Supported by

[solved] Running item from inline script?

edited January 2014 in OpenSesame

Hy there,

how can i run a single item (e.g. a text_input) from an inline script, e.g. if the text_input was left empty by a participant. i guess sth. like self.experiment.run(), right?

Cheers & Thanks,
Björn

Comments

  • edited 3:43AM

    Maybe i have found the correct code:

    self.experiment.items['name_of_item'].run()

    Is that correct?

    Cheers & Thanks,
    Björn

  • edited 3:43AM

    Hi Björn,

    Yep, that's it. I'm impressed that you figured it out, because it's hardly documented.

    One thing though: Some items require a prepare phase. For example, sketchpads construct a canvas in advance, because that prevents temporal delays during a trial. So you will want to execute the prepare phase as well:

    self.experiment.items['name_of_item'].prepare()
    self.experiment.items['name_of_item'].run()

    Cheers,
    Sebastiaan

  • edited 3:43AM

    Hi Sebastiaan,

    thank you! I have used the debug window to check out with exp.dict ;-)

    Cheers,
    Björn

Sign In or Register to comment.