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,
What happens here is:
canvas
is presented, but never seen on screen, as you immediately dotrial.stimuli[0]
andtrial.stimuli[1]
will be presented together, but never seen, as youtrial.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:
Prepare everything beforehand by plotting the three stimuli on a canvas, then present it as one stimulus:
Present the three stimuli sequentially without clearing the screen and only update the screen after the last stimulus:
Hope this helps.
Thank you for your complete answer.
It's a pleasure to hear your comments and thank you for your helps.
Glad I could help!