Howdy, Stranger!

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

Supported by

Newbie needing randomisation help!

edited February 2017 in OpenSesame

My experiment consists of watching a RSVP stream of coloured images of animals. Participants have to identify Target 1 [T1] which is a black and white image of an animal and then state if they saw a cat picture [cat_probe] in the stream or not. My questions are as follows:

  1. I have created a trial sequence using sketchpads of 10 images. I have adjusted the code on one so that it randomly displays a different target image each time using the file="bw_[T1].jpg" variable thing. However I also want to randomise all the other pictures in the stream but using the above system doesn't work! If I use the other variable [RSVP] I have created in this way then I simply get the same picture displayed in all 9 other sketchpad spaces. How can I randomise the other pictures to appear in any order?
  2. I would like T1 to appear in any position in the stream except the end 2 positions and for the [cat_probe] to appear in a +2 position after [T1] (eg. T1, random image, catprobe). How can I code this?
  3. I have made a widget form to collect the response to [T1] using images and have managed to get the correct answer to [T1] appear every time. However I would like the randomise the order it displays the possible choices in (at the moment the correct answer is always the first choice) and to randomise the other 2 animal choices it offers. The last option is a text choice of 'don't know' which can stay as the last choice.

I have very very limited knowledge of coding and of Open Sesame in general so very basic instructions are greatly appreciated!

Sorry for the long list and thank you to anyone who has the patience to help!

Comments

  • Hi,

    Let's start with points 1 and 2. An attentional-blink experiment is tricky to implement, and the best way is to use a bit of scripting. Here's an example of how you can do approximately what you want: It shows a stream of 10 letters, with a target ('X') and a cat probe ('C').

    This should be in the prepare phase:

    import random
    
    # We have eight distractors, one target, and a cat probe
    rsvp = list('abcdefgh')
    target = 'X'
    cat = 'C'
    
    # Randomly shuffle the rsvp stream, then randomly select
    # a target index (= position in the stream) and cat index
    # (two positions after the target). Then we insert the
    # target and the cat into the rsvp stream at the correct
    # positions.
    random.shuffle(rsvp)
    target_index = random.randint(0, 7)
    cat_index = target_index + 2
    rsvp.insert(cat_index, cat)
    rsvp.insert(target_index, target)
    
    # Now we create a list of canvas objects. We do this first
    # so that we have no preparation time when showing the canvas
    # objects later.
    canvas_list = []
    for stim in rsvp:
        stim_canvas = canvas()
        stim_canvas.text(stim)
        canvas_list.append(stim_canvas)
    

    And this in the run phase:

    # And now we show all canvas objects with a 90 ms
    # delay between them!
    for stim_canvas in canvas_list:
        stim_canvas.show()
        clock.sleep(90)
    

    Of course, you'll want to change this so that it shows images, rather than letters. And maybe a blank in between the images, etc. But first try that yourself as an exercise. If you follow the beginner and intermediate tutorials, you should get a long way!

    Cheers,
    Sebastiaan

  • edited March 2017

    Thanks Sebastiaan, I had found this in the tutorials but couldn't figure out how to import my image files into it as the list refers to letters. I have now made my main sequence using 10 different variables to randomise the sketchpads (a very long-winded way but it made more sense to me than the code!). However, I still need to randomise the widget response page. I currently have this code in place and it works perfectly:

    set timeout infinite
    set spacing 25
    set rows "1;1;1;1"
    set question "Select the black and white animal you saw. Or select 'don't know'"
    set options "draw image center=1 file=c_bird.jpg scale=1 show_if=always"
    set only_render no
    set margins "50;100;50;100"
    set form_var response
    set form_title "Form title"
    set description "A simple multiple choice item"
    set cols "1;1"
    set button_text Ok
    set allow_multiple no
    set advance_immediately yes
    set theme gray
    widget 0 0 2 1 label text="Target selection"
    widget 0 1 2 1 label center=no text="Select which black and white animal you saw or if you don't know select 'don't know' "
    widget 0 2 1 1 image_button path="bw
    [T1].jpg"
    widget 1 2 1 1 image_button path="bw_[picture3].jpg"
    widget 0 3 1 1 image_button path="bw_[picture2].jpg"
    widget 1 3 1 1 button text="Don't know"

    How can I adapt this code so that it randomises the order my widget buttons appear on the screen? At the moment the right answer is always the first button [T1].

    Thanks,
    Jenny

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