Howdy, Stranger!

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

Supported by

Batch session synchronization fails

Dear Jatos-team,

just now I updated my local installation to the latest Jatos version (was on Jatos 3.5.5. before) because our Server (run by the IT department) was updated lately too and it was recommended to update the local version as well. Upon testing if my experiment still worked, I find that the batch session data are causing issues.

My study is divided into 3 sessions which is why I am using batch session data. This way I keep track of the session count and also store the session randomization. I have used it like this for the pilot study and it worked without issues. However, now the callback function returns that the Batch session synchronization fails.

I have tested two things:

  1. use the cade as shown above (as always)
  2. assign a value to prolific_ID by hand ("var prolific_ID = "sub01")

That way both conditional statements were tested (i.e. retrieveData is undefined (1. case) and defined (2. case). Apparently jatos.batchSession.set and jatos.batchSession.add do not do their jobs. For "set", nothing happens, no subject entry is created. And for "add" the existing output is not altered. Importantly, in both cases the variables sess_order and last_idx contain the info they are supposed to contain. Do you happen to have any idea what is going wrong?


 var prolific_ID = jatos.urlQueryParameters.PROLIFIC_PID; //"sub01";

 console.log(prolific_ID);

 

 // get all the info from JATOS batch session

 var retrieveData = jatos.batchSession.getAll()[prolific_ID]

console.log(retrieveData)

// if subID does not yet exists, create template

if (retrieveData == undefined){

      var sess_order = (shuffle([5, 6, 7])); // refers to the component positions in jatos

      var last_idx = 0;

      jatos.batchSession.set(prolific_ID, {sess:sess_order, last:last_idx})

       .then(() => console.log("Batch Session was successfully updated"))

       .catch(() => console.log("Batch Session synchronization failed"));

     console.log(sess_order)

     console.log(last_idx)


   } // if subID does exist, update the info in template

else if (retrieveData != undefined) {

     var BatchField = prolific_ID;

     var blockInfo = new Object;

     var sess_order = jatos.batchSession.get(prolific_ID+"/sess") // keep randomization

     var last_idx = jatos.batchSession.get(prolific_ID+"/last") +1 // add one session

     blockInfo["sess"] = sess_order

     blockInfo["last"] = last_idx


     jatos.batchSession.add("/"+BatchField, blockInfo)

       .then(() => console.log("Batch Session was successfully updated"))

       .catch(() => console.log("Batch Session synchronization failed"));

   }



Thanks in advance.

All the best,

Christina

Comments

  • Hi Christina,

    Please use the formatting for code. It makes it so much more readable ;)

    I just tried with my JATOS and the Batch Session seems to work fine:

    jatos.batchSession.set("b", "koala").then(() => console.log("Batch Session was successfully updated")).catch(() => console.log("Batch Session synchronization failed"));
    

    and

    jatos.batchSession.add("/c", "bear").then(() => console.log("Batch Session was successfully updated")).catch(() => console.log("Batch Session synchronization failed"));
    

    Both worked:

    Maybe your new JATOS installation isn't installed correctly. E.g. are WebSockets allowed there? The Batch Session needs them to work. When you open JATOS test page (myjatosdomain/jatos/test) do you see any failed tests?

    Best,

    Kristian

  • Hi Kristian,

    First of all, sorry for the sloppy code pasting!

    Thanks for your response. The issue actually disappeared without any work from my side. Upon retrying after reading your reply, it ran without any issues. So I guess the new installation just needed some time to settle in (I don't know if this makes any sense though).

    In any case, thanks for the great support as always!

    Best,

    Christina

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