Howdy, Stranger!

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

Supported by

[open] to program an experience related to the subject’s response

edited April 2015 in OpenSesame

Hi everyone,
I am a novice in using OpenSesame and python. I would like to be able to program an experience related to the subject’s response.

Task: the participant must choose 30 objects in a set 60.

First, we show an object to the subject, if the participant chooses this object, he presses the « q » key, but if he doesn’t want it, he presses the « m » key. When the participant presses one of these keys, the object disappears. After a certain delay (400ms, 600ms or 800ms), a basket full of items (basket_full) or an empty one (basket_empty) appears on the screen.

50% of the time, baskets are congruent with the subject’s response (for example: if the subject want the object he presses the « q » key and I show him a basket_full , if he doesn’t want the object he presses the « m » key and I show him a basket_empty).
The other half , the basket doesn’t match the subject’s response (for example: if the subject want the object he presses the « q » key and I show him a basket_empty, if he doesn’t want the object he presses the « m » key and I show him a basket_full).

However I would like to have 60 randomized trials:
10 trials with a delay = 400ms and congruent with the subject’s response
10 trials with a delay = 400ms and incongruent with the subject’s response
10 trials with a delay = 600ms and congruent with the subject’s response
10 trials with a delay = 600ms and incongruent with the subject’s response
10 trials with a delay = 800ms and congruent with the subject’s response
10 trials with a delay = 800ms and incongruent with the subject’s response

Could you, please, help me?
Thank you very much!
Agnès

Comments

  • edited April 2015

    Hi Agnès,

    The experiment you are describing sounds like a perfect case for the variable wizard. Check out step 3 of this tutorial to get a comprehensive explanation of how it works. Basically, what you need to do is clicking on variable wizardin a loop item and add all your variables with corresponding levels. As far as I understood this will be delay (400,600,800), and congruency (yes,no). The other variables (image and response), I would define later in the loop, e.g. picking 30 pictures randomly from a pool of 50 images within an inline_script. However, this is a personal preference, there are other ways of doing it. I recommend you try to set up your experiment by means of the variable wizard and see how far you get, later you will probably bump into other problems which you can post here again.

    Let me know if you need more help.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited 6:39PM

    Hi,

    First, thanks for your quick answer.

    Sorry, I have not been clear, here is my problem.

    I want 10 congruent trials and 10 incongruent trials when the delay is equal to 400 ms

    The trial is congruent:

    • If the subject presses the “q” key and if I show the picture “basket_full” (both conditions need to be applied)

    • If the subject presses the “m” key and if I show the picture “basket_empty” (both conditions need to be applied)

    The trial is incongruent:

    • If the subject presses the “m” key and if I show the picture “basket_full” (both conditions need to be applied)

    • If the subject presses the “q” key and if I show the picture “basket_empty” (both conditions need to be applied)

    I would like for opensesame to stock the subject’s responses and according to the subject’s responses opensesame should show a specific picture ( basket_empty or basket_full). Knowing, that I want 10 congruent trials and 10 incongruent trials.

    opensesame must stock 3 variables :

    • I= the input ( subject’s response “q” or “m”)
    • D= delay
    • O= output( basket_full or basket_empty)

    If opensesame counts 10 congruent trials, for example:

    Trial 1: [ “q”; 400, “basket_full]

    Trial 2: [ “q”; 400, “basket_full]

    Trial 3:[ “q”; 400, “basket_full]

    Trial 4: [“m”; 400, “basket_ empty]

    Trial 5: [“q”; 400, “basket_full]

    Trial 6: [“m”; 400, “basket_ empty]

    Trial 7: [ “m”; 400, “basket_ empty]

    Trial 8: [ “q”; 400, “basket_full]

    Trial 9: [ “m”; 400, “basket_ empty]

    Trial 10: [ “q”; 400, “basket_full]

    Then the eleventh trial must be incongruent:

    Trial 11: [ “q”; 400, “basket_ empty”] or [ “m”; 400, “basket_ full”]

    I have a coworker who knows more or less vba, we tried a “vba inspired” code (that I will later have to “translate” in python) to represent the logic behind this rigged randomization.

    Thank you very much

    Agnès

  • edited 6:39PM

    Hi Agnes,

    Just to be clear, is it essential that the ordering of trials is done in the way your vba suggests, that is, first are congruent trials sampled until there have been 10 and only after that incongruent trials are added, also up to 10. Or do you only want to make sure that there are equal numbers of congruent and incongruent trials (over the different delays), in which their order can be random?

    Sorry my confusion, but I don't know why you would opt for the first option.

    Thanks,

    Eduard

    Buy Me A Coffee

  • edited 6:39PM

    Hi Eduard,

    It is the second option, I want to make sure that there are equal numbers of congruent and incongruent trials (over the different delays), in which their order can be random.

    thank you

  • edited 6:39PM

    In this case, the strategy which I described (using the variable wizard) will make sure that every condition is presented equally often. So let's consider following:

    You specify a 2 variables. First is delay (400,600,800) and the second is congruency (congruent, incongruent). What the variable wizard does is combining these levels to create a matrix with all possible combinations (400c,400ic,600c,600ic,800c,800ic). Furthermore, you can specify the number of how often every conditions (called "cycles") is repeated. To do so, you just need to set the number of repeats to 10, and you will have 10 repetitions of every conditions, so 60 trials in total.
    So far this design won't include the choice of the participants (q vs m), but since this is completely in their hand, I don't think you want it to be specified, right?

    Am I still misunderstanding, or does this help?

    Eduard

    Buy Me A Coffee

  • edited 6:39PM

    Hi Eduard,

    This is the choice of the participants (“q” or “m”) + a specific picture (“basket_full” or “basket_empty”) wich determines if the trial is congruent or incongruent

    Example:

    Trial 1: Subject presses “m”

    I would like for opensesame to choose a picture (“basket_full” or “basket_empty”)only for the first 10 trials


    #sketchpad ( name:"basket") trials= 0 if trials<= 10: draw image 0 0 "basket_[basket_x].jpg" scale=1 center=1 z_index=0 show_if="always" trials=trials +1 if trials=> 10: break #opensesame must stock the pictures, the delay and the choice of the participants. #after the 10 first trials,onpesesame must count the number of congruent trials and incongruent trials congruent= 0 incongruent= 0 congruent2= 0 incongruent2= 0 congruent3= 0 incongruent3= 0 if delay=400: if response_keyboard =="m" and basket== "basket_empty.jpg": congruent= congruent + 1 if response_keyboard_ =="q" and basket== " basket_full.jpg ": congruent= congruent + 1 if response_keyboard =="m" and basket== "basket_full.jpg": incongruent = incongruent + 1 if response_keyboard_ =="q" and basket== " basket_empty.jpg ": incongruent =incongruent +1 if delay=400: if response_keyboard =="m" and basket== "basket_empty.jpg": congruent= congruent + 1 if response_keyboard_ =="q" and basket== " basket_full.jpg ": congruent= congruent + 1 if response_keyboard =="m" and basket== "basket_full.jpg": incongruent = incongruent + 1 if response_keyboard_ =="q" and basket== " basket_empty.jpg ": incongruent =incongruent +1 if delay=600: if response_keyboard =="m" and basket== "basket_empty.jpg": congruent2= congruent2 + 1 if response_keyboard_ =="q" and basket== " basket_full.jpg ": congruent2= congruent2 + 1 if response_keyboard =="m" and basket== "basket_full.jpg": incongruent2 = incongruent2 + 1 if response_keyboard_ =="q" and basket== " basket_empty.jpg ": incongruent2 =incongruent2 +1 if delay=800: if response_keyboard =="m" and basket== "basket_empty.jpg": congruent3= congruent3 + 1 if response_keyboard_ =="q" and basket== " basket_full.jpg ": congruent3= congruen3t + 1 if response_keyboard =="m" and basket== "basket_full.jpg": incongruent3 = incongruent3 + 1 if response_keyboard_ =="q" and basket== " basket_empty.jpg ": incongruent3 =incongruent3 +1 #if after the 10 first trials opensesame counts 10 congruent or incongruent trials for a specific delay #opensesame does the following: if delay= 400 and congruent => 10: if response_keyboard =="q": draw image 0 0 "basket_empty.jpg" scale=1 center=1 z_index=0 show_if="always" incongruent = incongruent + 1 if response_keyboard =="m": draw image 0 0 "basket_full.jpg" scale=1 center=1 z_index=0 show_if="always" incongruent = incongruent + 1 if delay= 400 and incongruent => 10: if response_keyboard =="q": draw image 0 0 "basket_empty.jpg" scale=1 center=1 z_index=0 show_if="always" congruent = congruent + 1 if response_keyboard =="m": draw image 0 0 "basket_full.jpg" scale=1 center=1 z_index=0 show_if="always" congruent = congruent + 1 if delay= 600 and congruent => 10: if response_keyboard =="q": draw image 0 0 "basket_empty.jpg" scale=1 center=1 z_index=0 show_if="always" incongruent2 = incongruent2 + 1 if response_keyboard =="m": draw image 0 0 "basket_full.jpg" scale=1 center=1 z_index=0 show_if="always" incongruent2 = incongruent2 + 1 if delay= 600 and incongruent => 10: if response_keyboard =="q": draw image 0 0 "basket_empty.jpg" scale=1 center=1 z_index=0 show_if="always" congruent2 = congruent2 + 1 if response_keyboard =="m": draw image 0 0 "basket_full.jpg" scale=1 center=1 z_index=0 show_if="always" congruent2 = congruent2 + 1 if delay= 800 and congruent => 10: if response_keyboard =="q": draw image 0 0 "basket_empty.jpg" scale=1 center=1 z_index=0 show_if="always" incongruent3 = incongruent3 + 1 if response_keyboard =="m": draw image 0 0 "basket_full.jpg" scale=1 center=1 z_index=0 show_if="always" incongruent3 = incongruent3 + 1 if delay= 800 and incongruent => 10: if response_keyboard =="q": draw image 0 0 "basket_empty.jpg" scale=1 center=1 z_index=0 show_if="always" congruent3 = congruent3 + 1 if response_keyboard =="m": draw image 0 0 "basket_full.jpg" scale=1 center=1 z_index=0 show_if="always" congruent3 = congruent3 + 1 #if after the 10 first trials opensesame does not count 10 congruent or incongruent trials for a specific delay #opensesame does the following: if congruent <= 10: if response_keyboard =="m": draw image 0 0 "basket_[basket_x].jpg" scale=1 center=1 z_index=0 show_if="always" congruent= congruent + 1 if response_keyboard_ =="q": draw image 0 0 "basket_[basket_x].jpg" scale=1 center=1 z_index=0 show_if="always" congruent= congruent + 1 if incongruent <= 10: if response_keyboard =="m": draw image 0 0 "basket_[basket_x].jpg" scale=1 center=1 z_index=0 show_if="always" incongruent = incongruent + 1 if response_keyboard_ =="q": draw image 0 0 "basket_[basket_x].jpg" scale=1 center=1 z_index=0 show_if="always" incongruent =incongruent +1 #then opensemame must give a feedback every 10 trials: print( "the number of objects in your basket is "[basket.count("basket_full.jpg"])

    Agnès

  • edited 6:39PM

    Hi Agnes,

    Sorry for not having responded earlier.

    I'm still not sure whether we're understanding each other (I tend to believe we're saying the some stuff just with different words). To be super clear, I wrote a basic version of this experiment to see, whether this is what you need. The logic is the same as I think you want to have, only stimulus set, and some other irrelevant (at least for now) parameters I set to my convenience.

    Have a look at this experiment and its log file. Is this what you're aiming at?

    Eduard

    Buy Me A Coffee

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