Howdy, Stranger!

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

Supported by

Control repetition and distribution of target words in an online Lexical Decision Task

Hi,

I am new to OpenSesame and firstly wanted to thank everybody involved for the wonderful work. I am trying to set up an online LD task using OSWeb/JATOS where:

  • a session consists of 100 items (out of over 50000)
  • the distribution of the items should be around 75% words, 25% non-words
  • ideally a participant only sees an item once (not only per session, but also in subsequent sessions)
  • the number of times an item is shown to participants is more uniformly distributed

Currently, I have pasted all items into a block loop with a "break if 100 responses have been given" condition and a random selection. This works just fine and assuming that participants do not do more than 20-30 session, not too many items should be repeated. I pasted the items into the loop because reading from a file did not seem to work when I tried the experiment with OSWeb.

My questions: how could I achieve a distribution of 75:25 as mentioned above? And can I control how often items are shown in total/to each participant? I have implemented a user input form for subject IDs (as described here: https://kvonholzen.github.io/Tutorials_Open_Sesame_Lexical_decision_OSWeb.html#Create_a_subject-specific_code), could that be helpful?

Many thanks in advance!


Best,

Tim

Comments

  • Hi Tim

    I don't know whether reading loop tables (or anything) from file is currently supported in OSweb. The straightforward solution would be to have the logfile for each subject/session in the pool, and use that file to infer which items were already used and select others. As using files doesn't seem to be an option, you could hardcode the total list of items in your experiment and use the subject-specific randomization to index the set of items. In the process you can also easily add the 75-25 part. Here is an example of how to do it in Python. However, as osweb requires javascript you would have to translate the code (I'm not particularly good with js myself, sorry).

    import random
    # set some variables
    subj_nr = 1
    sess_nr = 2
    nr_items = 10
    nr_words = 7
    # set the random seed, to control which words were shown
    random.seed(subj_nr)
    # define more variables
    item_list = []
    words = ["This","manuscript","describes","an","EEG","study","that","employed","a","visual","search","paradigm","to","examine","the","influence","of","maintaining","versus","dropping","a","memory","item","on","electrophysiological","markers","of","attention.","Participants","had","to","memorize","two","colors","per","trial,","one","of","which","was","cued","as","task-relevant","for","the","an","upcoming","memory","search."]
    nonwords = ['asd','asdsda','gsdfsd','wgsd','fsd','adasd','6uy','uyaasd','adas','vasc','asday','jeeszfc']
    
    # shuffle the stimuli lists (shuffling is reproducible)
    random.shuffle(words)
    random.shuffle(nonwords)
    # select items based on session number
    item_list+=(words[nr_words*(sess_nr-1):nr_words*sess_nr])
    item_list+=(nonwords[(nr_items-nr_words)*(sess_nr-1):(nr_items-nr_words)*sess_nr])
    # shuffle again to mix words with nonwords
    random.shuffle(item_list)
    


    I hope this helps,

    Eduard

    Btw: This discussion could be useful to translate the code to javascript

    Buy Me A Coffee

  • Hi Eduard,

    many thanks for your response. As I said I am quite new to OS and I don't quite understand how I would feed my block loop with this new shuffled list (but I found some code that does the shuffling in JavaScript at least), i.e. were to place the inline_script and how to access it from within the loop. And do you by any chance know how I would achieve this implementation with JavaScript?

    Best,

    Tim

  • Hi TIm, this newly shuffled list would replace a column of the loop table. So this would mean that per trial you would have to index every item of it one by one. So, for example you could have an inline_javascript item in the beginning of your trial loop in which you extract this item. In Python this would be:

    var.current_item = item_list[current_trial_index]

    in Javascript probably almost the same:

    vars.current_item = item_list[current_trial_index]

    As you can see you need another variable for this. Namely the current trial index, which is basically just a counter of your trials. You could add it to the loop table for simplicity's sake. If you do, you can either set the loop to be randomized or to be sequential. If you choose sequential, you need to make sure to have shuffled your list beforehand. If you shuffle, you don't need to do the final shuffling when you create your item_list.

    Attached an example that implements this post here. I am sure you can build from there the procedure in the initial post of mine.

    As I said I am quite new to OS and I don't quite understand how I would feed my block loop with this new shuffled list

    It is never too late to do some tutorials or try to learn something about Python/javascript. It may feel a bit like side-tracking now (when you want to build your experiment), but it is definitely a great investment in the future. So check out our tutorials, and maybe also some video tutorials on Sebastiaan's youtube channel.

    I hope this helps!

    Eduard


    Buy Me A Coffee

  • Hi Eduard,

    yes, your input helped a lot! I managed to collect some JS snippets to translate your code and it seems to work as expected. I haven't tried it with all 50000 items yet (I guess it will noticeably impact loading times?), but here is what I've got in case anyone is interested:

    vars.sess_nr = 1
    vars.nr_items = 10
    vars.nr_words = 7
    vars.subj_nr = 3
    
    // Function that defines a reproducible random shuffle (seed = subject number)
    function shuffle(array, seed) {                
      var m = array.length, t, i;
    
      // While there remain elements to shuffle…
      while (m) {
    
        // Pick a remaining element…
        i = Math.floor(random(seed) * m--);        
    
        // And swap it with the current element.
        t = array[m];
        array[m] = array[i];
        array[i] = t;
        ++seed                                     
      }
    
      return array;
    }
    
    function random(seed) {
      var x = Math.sin(seed++) * 10000; 
      return x - Math.floor(x);
    }
    
    
    vars.word= ["This","manuscript","describes","an","EEG","study","that","employed","a","visual","search","paradigm","to","examine","the","influence","of","maintaining","versus","dropping","a","memory","item","on","electrophysiological","markers","of","attention.","Participants","had","to","memorize","two","colors","per","trial,","one","of","which","was","cued","as","task-relevant","for","the","an","upcoming","memory","search."]
    
    vars.non_word= ['asd','asdsda','gsdfsd','wgsd','fsd','adasd','6uy','uyaasd','adas','vasc','asday','jeeszfc']
    
    shuffle(vars.word, vars.subj_nr)
    shuffle(vars.non_word, vars.subj_nr)
    
    vars.final_list = []
    
    
    //Add words and non-words to items. The words are selected based on their indices.
    //The range of indices is based on the session number.
    for (var i = ((vars.nr_words*vars.sess_nr)-vars.nr_words); i < (vars.nr_words*vars.sess_nr); i++) {
      vars.final_list[vars.final_list.length] = vars.word[i];
    }
    for (var i = (((vars.nr_items-vars.nr_words)*vars.sess_nr)-(vars.nr_items-vars.nr_words)); i < ((vars.nr_items-vars.nr_words)*vars.sess_nr); i++) {
      vars.final_list[vars.final_list.length] = vars.non_word[i];
    }
    
    shuffle(vars.final_list, vars.subj_nr)
    

    The session and subject number will be retrieved from user input (as done here: https://kvonholzen.github.io/Tutorials_Open_Sesame_Lexical_decision_OSWeb.html#Create_a_subject-specific_code), the shuffle function is from - surprise - SO (https://stackoverflow.com/questions/16801687/javascript-random-ordering-with-seed).

    The last (rather minor) issue is that corrected responses cannot be logged. I guess this could be achieved by checking if the item on screen is found in vars.word, but again this might impact loading times significantly - might be more practicable to run a script on the final log files though.

    Thank you very much for your help, it was very valuable.


    Best,

    Tim

  • Thank you so much for sharing, @TOS21! Hope everything works as desired with the full stimulus list!

    And for determining the correct status of the participant's response (is that what you are referring to?) both methods that you were suggesting should work.


    Good luck!


    Lotje

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

  • Hi Lotje,

    yes, everything worked like a charm!

    And yes, I referred to the correct responses. It can easily be included at the beginning of the trial sequence with:

    if (vars.word.includes(vars.trial_item)){vars.correct_response = 'z';}
    else {vars.correct_response = 'm';}
    

    This does not work in OpenSesame ("includes()" came with a later version of JS), but it should work in most browsers with OSWeb. Of course the correct responses can/should be counter-balanced, but I did not bother to include it just yet :)

    Best,

    Tim

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