Howdy, Stranger!

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

Supported by

Alternating between lists

Hi!

I'm about to run an experiment that uses a Latin Square. I've coded it with jsPsych. So far I've created four lists and pseudo-randomised them (as I want them pseudo-randomised). I want each participant to see only one list. The stimuli are sentences.

My first idea was to randomly shuffle between them, so that jsPsych would randomly assign a list to each participant. This method seems to work, but it is too random, and it would force me to discard a lot of data.

I tried to use Jatos' jatos.startNextComponent and assign conditions, but it doesn't work either: Jatos can't go from one component to the other. The same happens when I download the template (Randomize Tasks Between Workers) task from the website (and I have Jatos 3.8.4).

Then I tried to create different batch sessions, which got me a little bit further:

 function initBatchConditions() {
      if (!jatos.batchSession.defined("/trials")) {
        jatos.batchSession.set("trials", 0).fail(initBatchConditions);
      }
      
      trials = jatos.batchSession.get("trials")
      jatos.batchSession.set("trials", trials + 1 ).fail(initBatchConditions); // If it fails: try again
        console.log(jatos.batchSession.getAll());
        console.log(trials % groups.length);
      return trials;
    }

This gets part of the job done: it selects between the four lists of stimuli. The problem is that then I cannot get <\trials> to be a defined variable.

Something goes wrong here (I think):

//changing the appareance of buttons
var btn_html = '<button class="jspsych-btn">%choice%</button>'

//the actual survey
var trial_structure = { 
  type: jsPsychHtmlButtonResponse,
  prompt:
    "<p><em>Rate this sentence</em></p>",
   choices: ["1", "2", "3", "4", "5", "6", "7"],
    stimulus: jsPsych.timelineVariable("sentence"),
    button_html: ['<p>Unacceptable        <button class="jspsych-btn">%choice%</button></p>', btn_html, btn_html, btn_html, btn_html, btn_html, '<p><button class="jspsych-btn">%choice%</button>        Perfect</p>']
};

 var trial_1 = {
timeline: [trial_structure],
      timeline_variables: groups[trials % groups.length] //takes a random group, feeds the sentences to the survey
    };

timeline.push(trial_1)

Apologies for the confusion! It is my first time coding and I'm "learning on the job".

Thanks!! Any help would be hugely appreciated.


Gianluca

Comments

  • Hi Gianluca,

    I didn't completely understand the third part of your question. I might be missing something obvious, but how does that relate to the batch session problem?

    Either way, I don't see an obvious problem with your use of the batch session functions. In fact if I run your code on the console (from any random JATOS study), then jatos.batchSession.defined("/trials") returns true.

    I also don't quite understand what didn't work with your first attempt. What do you mean, that jatos can't go from one component to the next? What error message do you get?

    With this information, I might be able to help more. This should be more or less easy to solve, I just didn't understand your problem yet :)

    Best

    Elisa

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