Howdy, Stranger!

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

Supported by

Debuggig JS & Version 4.0

edited June 2023 in OSWeb

Hey Guys,


I have several questions regarding the usage of js_inline_scripts. I first set my experiment (IAT with audio stimuli) up in python (since I'm more fluent in that) and am now in the process of translating it and debugging the translation. Also, I use the 4.0 version since I read here in the forum that there seem to be some seemingly helpful adjustments regarding JavaScript in the new version and general advice to set up new experiments in the new version. Therefor, I also have a few questions regarding the version switch.

At first, my questions regarding the debugging of JS code.

1) Are there general sources you would recommend me for help and advice for this process? I feel like a lot of trouble I'm confronted with comes from OS specifics and not the JavaScript code being wrong per se. Meaning some resources of documentation, summing up OS specifics when it comes to JS would be great (especially when they'd be updated for the new version).

2) Becoming a bit more specific. How and where should I run my experiment to make debugging easiest? I tried running it locally, as I did with the python version. Though at one point when doing a quickrun OS stops opening a "stopped" field although it detects an error and only refers to the console. Afterwards I tried running it in the browser, where different errors occur and are detected. At least in the browser, I receive a proper error message - though one of them isn't particularly helpful (referring to a line in my JS code that does not exist). What kind of debug strategy would you recommend? Running in browsers or running locally and using the console for debugging?

3) Getting more detailed now on JavaScript. Have in mind all questions are in context of the new 4.0 version. One error I receive (i already referred to this one two questions ago), when running the experiment locally from the console, states:

The "occurred online None" - is really giving me a hard time here :D.

4) Second question on my current code. When running the experiment in browser, I receive an error calling that one variable that is referred to in a sketchpad as [blocknumber] does not exist. I do define the variable via: blocknumber = 1 and: vars.blocknumber = blocknumber in a prior inline_js. So how comes it is not found from the sketchpad? I can imagine that this has something to do with how variables and functions declared in inline_js are transferred between items in OS- though I thought that that would have become more intuitive with the new version, right?

5) Following that error, my browser presents another error found. I guess it occurs because I still have a vars.set() statement in my inline_js which I know does not work. Still, it thought to include this error here because of a detail in the error message, referring to a code line 4137 in my inline_js, although the script only has ~140 lines.

6) Now one question related more the updated in the new version. As said above, the experiment I'm working on was first build locally using inline_python. Yesterday I thought giving the 4.0 OS version a try. But when I try running my stable python version I receive new errors. In my former version, I used a self.sleep() statement to manipulate time. Now it seems that in the newer version, OS is no more capable of referring to self (it gives me an error stating that). I changed to import time and time.sleep() though now my code runs way slower (might also be due to the general update and not this specific line). Can you tell me if/ why the update has precluded the self to be called? And do you have other recommendations other than time.sleep() as alternatives?


Sorry for the very long post and thank you a lot in advance!

Comments

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