"Uncaught TypeError" when porting gabor experiment to OSWeb
in OSWeb
I have a basic category learning experiment that utilizes gabors that runs readily on my computer locally, but when I try to run it in browser, I see this error message:
Two of the initial screens appear, but immediately after the error message prevents any further progress. Any thoughts on how to fix this?
Comments
Hi @albertyang ,
OSWeb supports only a subset of the functionality that OpenSesame supports. You can find an overview of supported functionality here:
In your case, the problem is that
inline_scriptitems are not supported. So you will need to find a way to implement that same functionality with asketchpad. Looking at your code, I think that should be doable though.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi @sebastiaan,
Thanks for the response! Do you mean that I should swap out the
inline_scriptforinline_javascript, or is there some more functionality withsketchpadthat would be sufficient to do the processing I have in mind? If I were usinginline_javascript, how could I work around using aCanvas?Thanks for all the help!
Albert
Hi @albertyang ,
Insofar as I can see, you only really need the Python
inline_scriptto determine the properties of the Gabor stimulus:So what you could do instead is use a simple
inline_javascriptto determine these properties:And then you use these variables (
[gabor_ori]and[gabor_sf]) to determine the gabor element of asketchpad:Does that make sense?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi @sebastiaan,
Sorry for the basic questions as I am very new to Javascript and OpenSesame. While I understand the switch you made to the
inline_javascript, is there a native gabor functionality to Javascript such that the code you attached should be sufficient as is? I edited the code as you showed, with my current rendition below. Whenever I try to run this, I always encounter a SyntaxError: Line 1: Unexpected identifier with the assignment of the Gabor stimulus properties. Do you know what the issue could be with this, or do you have any other guidance? Thanks again for all your help.Best,
Albert Yang
Hi @albertyang ,
Just to clarify, this:
Should go in the script of a
sketchpad, which you can access by clicking on the View → View Script button at the top-right of thesketchpadcontrols. So this is not JavaScript!See also:
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!