Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Display 3 stimuli on one page

I am programming my cognitive task using expyriment. But I had some difficulty in representing 3 stimuli at the same time. In my task, there is a target word at the top of the page and beneath to that, there are two words ( 3 words as stimuli in one trial) that participant has to select between one of the two beneath words. using the code below I could not do that as it only represents stim 3. Could you please provide me a solution? apart from that, I have 120 of those trials ( each consist of 3 words), how can I load them as a list that automatically update at the orginal position?

Kind Regards

import expyriment

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

stim1 = expyriment.stimuli.TextLine(text="Hello World", position=(300,0))
stim1.preload()
stim2 = expyriment.stimuli.TextLine(text="Hello World", position=(-300,0))
stim2.preload()
stim3 = expyriment.stimuli.TextLine(text="Hello World", position=(0,150))
stim3.preload()

expyriment.control.start()
stim1.present()
stim2.present()
stim1.present()

exp.clock.wait(1000)

expyriment.control.end()

Comments

  • fladdfladd Posts: 75

    Hi Juliette,

    there are two ways to achieve what you want:

    1. First create a transparent canvas to plot all three stimuli to, then present this canvas. This is most often the easiest solution
      canvas = expyriment.stimuli.Canvas(size=(500, 500))  # Adapt size to fit all three stimuli on it
      stim1.plot(canvas)
      stim2.plot(canvas)
      stim3.plot(canvas)
      canvas.present()
    2. You can also present stimuli over what is currently on the screen, but you then need to take care of potential double buffering
      stim1.present(update=False)  # needs to be called once per used video buffer
      stim2.present(clear=False, update=False)  # needs to be called once per used video buffer
      stim3.present(clear=False)  # needs to be called once per used video buffer

    Let me know if you have any further questions.

    Florian Krause (Developer)
    http://www.expyriment.org

Sign In or Register to comment.