Howdy, Stranger!

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

Supported by

"Uncaught TypeError" when porting gabor experiment to 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_script items are not supported. So you will need to find a way to implement that same functionality with a sketchpad . Looking at your code, I think that should be doable though.

    Cheers!

    Sebastiaan

    Buy Me A Coffee

  • Hi @sebastiaan,

    Thanks for the response! Do you mean that I should swap out the inline_script for inline_javascript, or is there some more functionality with sketchpad that would be sufficient to do the processing I have in mind? If I were using inline_javascript, how could I work around using a Canvas?

    Thanks for all the help!

    Albert

  • Hi @albertyang ,

    Insofar as I can see, you only really need the Python inline_script to determine the properties of the Gabor stimulus:

    c = Canvas()
    c.text(var.category)
    c.gabor(0, 0, -1.98 *(.045 * var.orientation + 1), (var.spatial_freq / 30) + .25, env='circular', size=500,stdev=60)
    

    So what you could do instead is use a simple inline_javascript to determine these properties:

    vars.gabor_ori = -1.98 * (0.45 * vars.orientation + 1)
    vars.gabor_sf = (vars.spatial_freq / 30) + .25
    

    And then you use these variables ([gabor_ori] and [gabor_sf] ) to determine the gabor element of a sketchpad :

    draw gabor bgmode=avg color1=white color2=black env=circular freq=[gabor_sf] orient=[gabor_ori] phase=0 show_if=always size=500 stdev=60 x=0 y=0 z_index=0
    

    Does that make sense?

    Cheers,

    Sebastiaan

    Buy Me A Coffee

  • 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

  • edited August 20

    Hi @albertyang ,

    Just to clarify, this:

    draw gabor bgmode=avg color1=white color2=black env=circular freq=[gabor_sf] orient=[gabor_ori] phase=0 show_if=always size=500 stdev=60 x=0 y=0 z_index=0
    

    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 the sketchpad controls. So this is not JavaScript!

    See also:

    Cheers,

    Sebastiaan

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games