Howdy, Stranger!

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

Supported by

Why is it that when I click "quick run" it works, but when I click "run in browser" it gets an error

I did a simple experiment, using inline_script insert statement to control the experiment time: exp.start_time =self.time (), and in the loop break if set = self.time-self. get('start_time') >= 120000.


However, in the process of testing, I found that "Quick Run" could be used, and the test in OSWeb would report an error. What is the problem? Thank you!


Comments

  • Hi @DDD ,


    Python inline_script items are not supported in OSWeb, the OpenSesame extension for running experiments online:



    Instead, you could using inline_javascript items.



    So if you are running a study online, by using OSWeb, you should transfer your Python code to JavaScript. To get the current time stamp, for example, you could use the following script in an inline_javascript item:


    // Get the starting time and store it in the vars object
    let date = new Date();
    vars.starting_time = date.getTime();
    


    Does this help?


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Hi, Lotje:

    I've tried your method, but it still doesn't work. Can I write the break if statement like this? Is it an error in break if?

    Thank you!

  • HI,

    It would be much easier to help you with your problems if we had an error message. That way, we could narrow down the problem to where in the script/sequence the problem occurred. In firefox, you can see the error message, if you open a console before running the experiment by pressing CTRL+SHIFT+C

    Can you try to find an error message and post it here?

    Can I write the break if statement like this? Is it an error in break if?

    I am not entirely sure, but I don't think so. I recommend you do following thing

    1. initialize a variable that tracks the duration of the period you are counting. This must occur before the loop in which you are using that variable is run. That would be something like `vars.duration = 0`
    2. the break if statement you can then write as "[duration]>120000"
    3. Make sure that on every iteration of the loop, you update the duration. For this you can basically use the code you have in your run if statement.

    But again, if we see an error message, we can have a closer look on what is happening. Alternatively, you can also share your experiment here, and we can have a look directly there.

    Eduard

    Buy Me A Coffee

  • Hi @DDD ,


    Sorry, I missed your post, but luckily Eduard helped out. Just to follow up:

    Can I write the break if statement like this? Is it an error in break if?

    No, this if-statement indeed won't work. If you precede an if-statement with the "equal" ("=") sign, this means that some Python script will follow. And Python script is not supported in OSWeb.

    Eduard's solution will work fine, because here the if-statement is written in OpenSesame script, by using the square-bracket notation.


    Hope this clarifies it a bit.


    Cheers,


    Lotje

    Did you like my answer? Feel free to 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