Howdy, Stranger!

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

Supported by

Triangle stimuli in a block

Dear Florian,

I am sorry to take your time so often, actually, I am implementing few different tasks into Expyriment.
In the code below I tried to represent a trial with triangle structure in each trial as you can see below: I first prepared stimuli and add it to the block. ( I took out unnecessary parts of code)

    exp = expyriment.design.Experiment(name="TASK")
    expyriment.control.initialize(exp)

    for row_num in range(0, rows):
        # read stimuli from excel file 
        block_one = expyriment.design.Block(name="activation")
        var="trial"+str(row_num)

        var = expyriment.design.Trial()
        stim1 = expyriment.stimuli.TextLine(text=words[key][0], position=(0,200),text_size=42)
        stim2 = expyriment.stimuli.TextLine(text=words[key][1], position=(-250,-250),text_size=42)
        stim3 = expyriment.stimuli.TextLine(text=words[key][2], position=(250,-250),text_size=42)  
        stim1.preload()
        stim2.preload()
        stim3.preload() 
        var.add_stimulus(stim1)
        var.add_stimulus(stim2)
        var.add_stimulus(stim3)
        block_one.add_trial(var)
        exp.add_block(block_one)

In the next part, I tried to start the experiment as below:

    expyriment.control.start()

    for block in exp.blocks:
      for trial in block.trials:

         canvas = expyriment.stimuli.Canvas(size=(600, 600)) 
         canvas.present()
         trial.stimuli[0].present(update=False)
         trial.stimuli[1].present(clear=False, update=False)
         trial.stimuli[2].present(update=False)
         exp.clock.wait(2000)

    expyriment.control.end()

But it doesn't show all three stimuli in triangle form in each trial . Do you please have any advice for me?

Comments

  • Hi Juliette,

    canvas.present()
    trial.stimuli[0].present(update=False)
    trial.stimuli[1].present(clear=False, update=False)
    trial.stimuli[2].present(update=False)
    

    What happens here is:

    1. canvas is presented, but never seen on screen, as you immediately do
    2. trial.stimuli[0] and trial.stimuli[1] will be presented together, but never seen, as you
    3. are clearing the screen when presenting trial.stimuli[2], so now, trial.stimuli[2] should be the only stimulus on screen.

    It seems to me that you are mixing two different presentations techniques here. If you just want to present all thee stimuli on the screen, there are to ways to achieve this:

    1. Prepare everything beforehand by plotting the three stimuli on a canvas, then present it as one stimulus:

      exp = expyriment.design.Experiment(name="TASK")
      expyriment.control.initialize(exp)
      
      block_one = expyriment.design.Block(name="activation")
      var = expyriment.design.Trial()
      stim1 = expyriment.stimuli.TextLine(text=words[key][0], position=(0,200),text_size=42)
      stim2 = expyriment.stimuli.TextLine(text=words[key][1], position=(-250,-250),text_size=42)
      stim3 = expyriment.stimuli.TextLine(text=words[key][2], position=(250,-250),text_size=42)
      canvas = expyriment.stimuli.Canvas(size=(600, 600))
      stim1.plot(canvas) 
      stim2.plot(canvas) 
      stim2.plot(canvas)
      canvas.preload()
      var.add_stimulus(canvas)
      block_one.add_trial(var)
      exp.add_block(block_one)
      
      expyriment.control.start()
      
      for block in exp.blocks:
         for trial in block.trials:
             trial.stimuli[0].present()
             exp.clock.wait(2000)
      
      expyriment.control.end()
      
    2. Present the three stimuli sequentially without clearing the screen and only update the screen after the last stimulus:

      exp = expyriment.design.Experiment(name="TASK")
      expyriment.control.initialize(exp)
      
      block_one = expyriment.design.Block(name="activation")
      var = expyriment.design.Trial()
      stim1 = expyriment.stimuli.TextLine(text=words[key][0], position=(0,200),text_size=42)
      stim2 = expyriment.stimuli.TextLine(text=words[key][1], position=(-250,-250),text_size=42)
      stim3 = expyriment.stimuli.TextLine(text=words[key][2], position=(250,-250),text_size=42) 
      stim1.preload()
      stim2.preload()
      stim3.preload()
      var.add_stimulus(stim1)
      var.add_stimulus(stim2)
      var.add_stimulus(stim3)
      block_one.add_trial(var)
      exp.add_block(block_one)
      
      expyriment.control.start()
      
      for block in exp.blocks:
         for trial in block.trials:
             trial.stimuli[0].present(update=False)
             trial.stimuli[1].present(clear=False, update=False)
             trial.stimuli[2].present(clear=False)
             exp.clock.wait(2000)
      
      expyriment.control.end()
      

    Hope this helps.

  • Thank you for your complete answer.
    It's a pleasure to hear your comments and thank you for your helps.

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