Self.get method
Hello everyone,
I'm tring to convert this script (python code) in javascript, to make my project work on the web.
self.get('correct') == 0:
# Prepare the whole trial sequence again:
exp.items['sequenza_pratica'].prepare()
# And run it again:
exp.items['sequenza_pratica'].run()
I would be really grateful if anyone help, as i failed to find out how convert these methods.
Thank you
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAA/0lEQVR4AYXNMSiEcRyA4cfmGHQbCZIipkuxnJgMStlMNmeyD2dwmc8+sZgxYJd9ErIZFHUyYYD7fkr6l4/rnvmtl7+KitrqV/fq2Y5eLY3Z9S48eRLe7BmVZ9qhTLhQ0algzZWQOVKSsCF8OjAnwbxDTWFDUhPK/jMr1H6HE/IqRky2DyvCefuwItwZzodVoYRiLqMkVCXrwpJ9twZ+sgfDYEFYl8wIWxZ9uFf7zkallxlJh4YrLGsKjZRx7VGHhLqwgFUN45DGdb8MeXGpgB4ABZdeDcpZEY51A+hyLKz4S1W4MQWm3AibWtgWmk6dyISa1pSdyWTOlLXVp0+eL9D/ZPfBTNanAAAAAElFTkSuQmCC
Comments
Hi,
Does this screenshot help?
Eduard
I second this post. @eduard I can't see where in your Javascript code you do the prepare and run of the Python code above🤷♀️
Hi,
I was trying to give an example of javascript coding. I don't know whether and how you can access items in a javascript inline script and execute them from there. I just tried to dig in github and the console to find where items are stored and how to access them. I did find them somewhere very deep in the structure, but couldn't find a way to access them. So, unfortunately, I can't be of any help here.
@Daniel, @sebastiaan, is it possible to access items from within an js_inline_script?
Eduard
@eduard @maj_zmaj In JavaScript, there's no
itemsobject as there is in Python. However, the code that was posted at the start of the discussion doesn't seem to do anything that a regular run-if statement ([correct] = 0) couldn't do. Or is there a reason that you want to do this programmatically?Check out SigmundAI.eu for our OpenSesame AI assistant!