Howdy, Stranger!

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

Supported by

[open] Randomly present two stimuli from 8 separate lists

edited September 2015 in OpenSesame

Hello,

I am attempting to build an experiment where I will present two picture stimuli at once side by side (on a sketchpad) in a random order and on random sides of the screen. One of the stimuli will be a 'real' while the other will be a 'foil'. Participants merely have to select one of the two stim. However, there are eight different groups to draw the images from (e.g., Real 1 vs Foil 1, Real 2 vs Foil 2, etc), such that the faces being compared always belong to the same group with the exception of 'real' and 'foil'

I've gotten pretty close to getting this to word by some if then statements in the sequence and an sketchpad for each scenario. But the sketchpad is still not appearing. Any help?

This is my in_line script for making the lists:

def my_function():
    print 'import random

Genuine_MMA = ['MMA1_Oval.jpg', 'MMA18_Oval.jpg', 'MMA19_Oval.jpg', 'MMA20_Oval.jpg']
Genuine_MMH = ['MMH21_Oval.jpg', 'MMH6_Oval.jpg', 'MMH7_Oval.jpg', 'MMH8_Oval.jpg']
Genuine_MFA = ['MFA1_Oval.jpg', 'MFA20_Oval.jpg', 'MFA3_Oval.jpg', 'MFA4_Oval.jpg']
Genuine_MFH = ['MFH18_Oval.jpg', 'MFH6_Oval.jpg', 'MFH7_Oval.jpg', 'MFH8_Oval.jpg']
Genuine_YMA = ['YMA1_Oval.jpg', 'YMA18_Oval.jpg', 'YMA19_Oval.jpg', 'YMA2_Oval.jpg']
Genuine_YMH = ['YMH20_Oval.jpg', 'YMH6_Oval.jpg', 'YMH7_Oval.jpg', 'YMH8_Oval.jpg']
Genuine_YFA = ['YFA1_Oval.jpg', 'YFA18_Oval.jpg', 'YFA3_Oval.jpg', 'YFA4_Oval.jpg']
Genuine_YFH = ['YFH19_Oval.jpg', 'YFH5_Oval.jpg', 'YFH7_Oval.jpg', 'YFH8_Oval.jpg']
Foil_MMA = ['MMA16_Oval.jpg', 'MMA17_Oval.jpg', 'MMA5_Oval.jpg', 'MMA4_Oval.jpg']
Foil_MMH = ['MMH11_Oval.jpg', 'MMH23_Oval.jpg', 'MMH26_Oval.jpg', 'MMH22_Oval.jpg']
Foil_MFA = ['MFA16_Oval.jpg', 'MFA17_Oval.jpg', 'MFA19_Oval.jpg', 'MFA7_Oval.jpg']
Foil_MFH = ['MFH11_Oval.jpg', 'MFH13_Oval.jpg', 'MFH23_Oval.jpg', 'MFH26_Oval.jpg']
Foil_YMA = ['YMA14_Oval.jpg', 'YMA15_Oval.jpg', 'YMA5_Oval.jpg', 'YMA3_Oval.jpg']
Foil_YMH = ['YMH10_Oval.jpg', 'YMH24_Oval.jpg', 'YMH26_Oval.jpg', 'YMH23_Oval.jpg']
Foil_YFA = ['YFA16_Oval.jpg', 'YFA17_Oval.jpg', 'YFA19_Oval.jpg', 'YFA3_Oval.jpg']
Foil_YFH = ['YFH10_Oval.jpg', 'YFH23_Oval.jpg', 'YFH25_Oval.jpg', 'YFH22_Oval.jpg']
side = ('up','down')

combined_MMA = zip(Genuine_MMA, Foil_MMA)
combined_MMH = zip(Genuine_MMH, Foil_MMH)
combined_MFA = zip(Genuine_MFA, Foil_MFA)
combined_MFH = zip(Genuine_MFH, Foil_MFH)
combined_YMA = zip(Genuine_YMA, Foil_YMA)
combined_YMH = zip(Genuine_YMH, Foil_YMH)
combined_YFA = zip(Genuine_YFA, Foil_YFA)
combined_YFH = zip(Genuine_YFH, Foil_YFH)

combined_all = zip(combined_MMA, combined_MMH, combined_MFA, combined_MFH, combined_YMA, combined_YMH, combined_YFA, combined_YFH)

random.shuffle(combined_all)
combined_MMA[:], combined_MMH[:], combined_MFA[:], combined_MFH[:], combined_YMA[:], combined_YMH[:], combined_YFA[:], combined_YFH[:] = zip(*combined_all)

random.shuffle(combined_MMA)
random.shuffle(combined_MMH)
random.shuffle(combined_MFA)
random.shuffle(combined_MFH)
random.shuffle(combined_YMA)
random.shuffle(combined_YMH)
random.shuffle(combined_YFA)
random.shuffle(combined_YFH)

exp.set('combined_MMA', combined_MMA)
exp.set('combined_MMH', combined_MMH)   
exp.set('combined_MFA', combined_MFA)
exp.set('combined_MFH', combined_MFH)
exp.set('combined_YMA', combined_YMA)
exp.set('combined_YMH', combined_YMH)
exp.set('combined_YFA', combined_YFA)
exp.set('combined_YFH', combined_YFH)

Genuine_MMA[:], Foil_MMA[:] = zip(*combined_MMA)
Genuine_MMH[:], Foil_MMH[:] = zip(*combined_MMH)
Genuine_MFA[:], Foil_MFA[:] = zip(*combined_MFA)
Genuine_MFH[:], Foil_MFH[:] = zip(*combined_MFH)
Genuine_YMA[:], Foil_YMA[:] = zip(*combined_YMA)
Genuine_YMH[:], Foil_YMH[:] = zip(*combined_YMH)
Genuine_YFA[:], Foil_YFA[:] = zip(*combined_YFA)
Genuine_YFH[:], Foil_YFH[:] = zip(*combined_YFH)

exp.set('Genuine_MMA', Genuine_MMA)
exp.set('Genuine_MMH', Genuine_MMH)
exp.set('Genuine_MFA', Genuine_MFA)
exp.set('Genuine_MFH', Genuine_MFH)
exp.set('Genuine_YMA', Genuine_YMA)
exp.set('Genuine_YMH', Genuine_YMH)
exp.set('Genuine_YFA', Genuine_YFA)
exp.set('Genuine_YFH', Genuine_YFH)
exp.set('Foil_MMA', Foil_MMA)
exp.set('Foil_MMH', Foil_MMH)
exp.set('Foil_MFA', Foil_MFA)
exp.set('Foil_MFH', Foil_MFH)
exp.set('Foil_YMA', Foil_YMA)
exp.set('Foil_YMH', Foil_YMH)
exp.set('Foil_YFA', Foil_YFA)
exp.set('Foil_YFH', Foil_YFH)
exp.set('side', side)
exp.set('combined_all', combined_all)

'

and here is the pop-in script

def my_function():
    print 'import random

Genuine_MMA_pick = Genuine_MMA.pop()    
Foil_MMA_pick = Foil_MMA.pop()  
Genuine_MMH_pick = Genuine_MMH.pop()    
Foil_MMH_pick = Foil_MMH.pop()  
Genuine_MFA_pick = Genuine_MFA.pop()    
Foil_MFA_pick = Foil_MFA.pop()  
Genuine_MFH_pick = Genuine_MFH.pop()    
Foil_MFH_pick = Foil_MFH.pop()  
Genuine_YMA_pick = Genuine_YMA.pop()    
Foil_YMA_pick = Foil_YMA.pop()  
Genuine_YMH_pick = Genuine_YMH.pop()    
Foil_YMH_pick = Foil_YMH.pop()  
Genuine_YFA_pick = Genuine_YFA.pop()    
Foil_YFA_pick = Foil_YFA.pop()  
Genuine_YFH_pick = Genuine_YFH.pop()    
Foil_YFH_pick = Foil_YFH.pop()  

Foil_side = random.choice(side)
if Foil_side == 'up':
    Genuine_side = 'down'
else:
    Genuine_side = 'up'

if Foil_side == 'up':
    cor_resp = 'up'
else:
    cor_resp = 'down'

exp.set('Foil_side', Foil_side)
exp.set('Genuine_side', Genuine_side)
exp.set('Genuine_MMA_pick', Genuine_MMA_pick)
exp.set('Foil_MMA_pick', Foil_MMA_pick)
exp.set('Genuine_MMH_pick', Genuine_MMH_pick)
exp.set('Foil_MMH_pick', Foil_MMH_pick)
exp.set('Genuine_MFA_pick', Genuine_MFA_pick)
exp.set('Foil_MFA_pick', Foil_MFA_pick)
exp.set('Genuine_MFH_pick', Genuine_MFH_pick)
exp.set('Foil_MFH_pick', Foil_MFH_pick)
exp.set('Genuine_YMA_pick', Genuine_YMA_pick)
exp.set('Foil_YMA_pick', Foil_YMA_pick)
exp.set('Genuine_YMH_pick', Genuine_YMH_pick)
exp.set('Foil_YMH_pick', Foil_YMH_pick)
exp.set('Genuine_YFA_pick', Genuine_YFA_pick)
exp.set('Foil_YFA_pick', Foil_YFA_pick)
exp.set('Genuine_YFH_pick', Genuine_YFH_pick)
exp.set('Foil_YFH_pick', Foil_YFH_pick)
exp.set('cor_resp', cor_resp)
'

And for good measure, here is the if then statements in the sequence:

def my_function():
    print 'run foil_MMA_up "[Foil_side] = up and [combined_all] = combined_MMA"
run foil_MMA_down "[Foil_side] = down and [combined_all] = combined_MMA"
run foil_MMH_up "[Foil_side] = up and [combined_all] = combined_MMH"
run foil_MMH_down "[Foil_side] =down and [combined_all] = combined_MMH"
run foil_MFA_up "[Foil_side] = up and [combined_all] = combined_MFA"
run foil_MFA_down "[Foil_side] =down and [combined_all] = combined_MFA"
run foil_MFH_up "[Foil_side] = up and [combined_all] = combined_MFH"
run foil_MFH_down "[Foil_side] =down and [combined_all] = combined_MFH"
run foil_YMA_up "[Foil_side] = up and [combined_all] = combined_YMA"
run foil_YMA_down "[Foil_side] =down and [combined_all] = combined_YMA"
run foil_YMH_up "[Foil_side] = up and [combined_all] = combined_YMH"
run foil_YMH_down "[Foil_side] =down and [combined_all] = combined_YMH"
run foil_YFA_up "[Foil_side] = up and [combined_all] = combined_YFA"
run foil_YFA_down "[Foil_side] =down and [combined_all] = combined_YFA"
run foil_YFH_up "[Foil_side] = up and [combined_all] = combined_YFH"
run foil_YFH_down "[Foil_side] =down and [combined_all] = combined_YFH"
run Recall_keyboard_response "always"
run logger "always"'

I'm apparently stonewalled.

Comments

  • edited 5:08AM

    Hi Troy,

    It seems that you picked all your variables thoroughly; (but next time you might want to use a for-loop to mix 'n' match the pictures, so that you don't have to write 100 lines of code!). Honestly, the easiest way to finish up, now that you've everything in the prepare phase of your inline_script, is to draw a canvas in that same prepare phase and display it in the run phase. You won't need a sketchpad.

    Every trial, make sure you have a "picture1" and a "picture2" variable. Note that these variables should contain absolute paths to the image files; see also http://osdoc.cogsci.nl/python/canvas/#function-__canvasimage__fname-ynone-xnone-scalenone-centertrue
    The "up" and "down" variables could be coordinates. To create the canvas, you add:

         from openexp.canvas import canvas
         your_canvas = canvas(exp)
         your_canvas.image(picture1, y = up)
         your_canvas.image(picture2, y = down)
    

    Then, in the run phase, you add:

         your_canvas.show()
    

    Let me know if this works.
    Good luck!

    Joshua

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