Howdy, Stranger!

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

Supported by

communicate with the JATOS mysql database from within jspsych code

Hello, I am wondering if I can make my own custom mysql commands?

I am planning to add additional tables to the JATOS dB schema, which I would like to communicate with via jsPsych. They will only point to the Components table and not any of the data.

My biggest concern is how to use the dB credentials. Any ideas would be great.

Thank you,

Jason

Comments

  • Hi Jason!

    I want to express my deepest concern about changing JATOS database scheme. You might end up with a broken JATOS installation.

    That said, how do you want to access MySQL from jsPsych? It runs in the browser, isn't it? There is usually no way to access the backend's database from the frontend (and for good reasons).

    What are you actually trying to achieve? Maybe I have an idea.

    Best,

    Kristian

  • Me break anything?!? ;) That is why I work with three installs!

    I use what I call Batteries. These are lists of components where each component has its own set of configuration parameters. This allows me to have ONE Stroop task component but a whole bunch of different parameter settings.

    Right now, I have a file called "Batteries.js" that contains all of my different Batteries. I use jsPsych/JATOS for at least half a dozen different experiments (or student projects). I have a single Study in JATOS and about 40 components. In my Batteries.js are all the different "experiments," which are lists of the components to use and the associated parameter sets. Each Battery also has its own "number." I add a URL parameter containing the "number" of the battery I want to use at the end of the JATOS link. I have a "UsageManager" component that reads the Batteries.js file and finds the correct list of tasks to use based on the URL parameter. Then it loads up the "config" files for each component and searches for the correct parameter set specified in the Batteries.js file.

    The bottom line is that there is a lot of extra searching and loading up files that are getting more and more bloated. (My code has grown to the point where my methods are now almost too convoluted to keep track of) The idea is to put all of these batteries and all of the different parameter sets into a database. This will make it MUCH easier to search and load data.

    I do not HAVE to have these tables in the same JATOS dB since there does not need to be any direct linkage between my proposed tables and the JATOS tables. I just thought it would be nice to only deal with a single database.

    >>That said, how do you want to access MySQL from jsPsych?

    I would like to have my javascript code communicate with the dB to load information.

    >>It runs in the browser, isn't it? There is usually no way to access the backend's database from the frontend (and for good reasons).

    Yes, it all runs in the browser and I theoretically understand why there should be no front to back end communication. But how does JATOS communicate? Isn't that from to back?

    Thanks for reading,

    Jason

  • Hi Jason,

    Sorry for taking so long to answer. I needed some free time to understand what are trying to do.

    I think, I understand your setup with JATOS and one single study containing multiple experiments and the battery.js defining those experiments (which components and parameters to use). And your problem is that your battery.js code gets bloated. To help with this you now want to put what's in battery.js in a database.

    First let me congratulate you for your ingenuity in using JATOS components and URL query parameters to run multiple experiments with one JATOS study. Usually people just have one component in a study - but JATOS can do so much more with components. I'm happy to see that it works.

    That said, in your case, why don't you divide your single JATOS study in several ones and spare this extra database? I mean this is what JATOS can do: have several studies for you together with their configuration. Each study can have multiple components. And each study is stored in JATOS' database. It feels to me as if you want to reinvent the wheel. But maybe I still miss something.

    Yes, it all runs in the browser and I theoretically understand why there should be no front to back end communication. But how does JATOS communicate? Isn't that from to back?

    JATOS has backend and frontend. The backend communicates with the database. There is no way to communicate directly from the frontend to the database without a backend facilitating this. In theory you would have to write your own backend to communicate from your JavaScript to the database. But I would advice against it. It would be quite some work for you. And I think you can achieve everything you want with the tools JATOS offers already.

    Best,

    Kristian

  • Hello Kristian,

    First let me congratulate you for your ingenuity in using JATOS components and URL query parameters to run multiple experiments with one JATOS study. Usually people just have one component in a study - but JATOS can do so much more with components. I'm happy to see that it works.

    Thank you. I am very happy with JATOS.

    I am going to sit with the schema diagram of the JATOS database and see what I can come up with. I am also working with two comp sci students who have "audited" my code and explained to me all the inefficient things that I have done. They have also removed some of my "code bloat" to make things load a lot more efficiently. I will be reviewing their work later this week.

    I agree that I may be making my life more complicated than it needs to be.

    Thank you,

    Jason

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