|
Post by menagodi on Apr 22, 2021 9:05:56 GMT
Good morning,
I am carrying an experiment for my Consumer Research class at Université de Genève, which consists of showing a series of events, that consist on displaying two pairs of images from which participants need to choose one of them by clicking on it, based on their perception of healthiness.
The code is simple, and there are similar experiments in the PsyToolkit website, but if anyone had carried out this same experiment before, it would be of great help if you could share the code.
Thank you,
Pablo
|
|
|
Post by matia on Apr 22, 2021 14:16:05 GMT
Hello,
hope this simple code can be of some help:
options mouse on
table try 1 255 0 0 0 0 255 -200 200 200 -200 #@1 which stimulus is the correct one 2 0 0 255 255 0 0 0 -200 0 200 #@2-@4 color of the first rectangle (red) 1 255 0 0 0 0 255 100 -100 -100 100 #@5-@7 color of the second rectangle (blue) 2 0 0 255 255 0 0 0 200 0 -200 #@8-@9 position of the first rectangle 1 255 0 0 0 0 255 -100 100 100 -100 #@10-@11 position of the second rectangle 2 0 0 255 255 0 0 100 0 -100 0 1 255 0 0 0 0 255 200 -200 -200 200 2 0 0 255 255 0 0 -100 0 100 0
task green table try show rectangle @8 @9 100 100 @2 @3 @4 #you can see that I am defining 1st rectangle's size with columns @8 and @9 show rectangle @10 @11 100 100 @5 @6 @7 #the size is fixed for both (100 x 100) but you can alter this also readmouse l @1 3000 #and the color is defined with the final three information (@2-@4 for the 1st and clear screen #@5-@7 for the second) delay 300 #finally, I tell it that the @1 contains the information on which is the correct save STATUS RT UNDER_MOUSE #stimulus (1 and 2 refer to the order with which they are defined within a task)
block green tasklist green 5 end
Just replace rectangles with images, and You are good to go. The task was to click on the red square which is shown alongside the blue one... Hope the table and the task code are clear. Ask away if I haven't provided a clear code.
Best, Matia
|
|
|
Post by menagodi on Apr 23, 2021 12:13:31 GMT
Thank you very much Matia. It was of great help for me!!! Have a nice weekend, Pablo Hello,
hope this simple code can be of some help:
options mouse on
table try 1 255 0 0 0 0 255 -200 200 200 -200 #@1 which stimulus is the correct one 2 0 0 255 255 0 0 0 -200 0 200 #@2-@4 color of the first rectangle (red) 1 255 0 0 0 0 255 100 -100 -100 100 #@5-@7 color of the second rectangle (blue) 2 0 0 255 255 0 0 0 200 0 -200 #@8-@9 position of the first rectangle 1 255 0 0 0 0 255 -100 100 100 -100 #@10-@11 position of the second rectangle 2 0 0 255 255 0 0 100 0 -100 0 1 255 0 0 0 0 255 200 -200 -200 200 2 0 0 255 255 0 0 -100 0 100 0
task green table try show rectangle @8 @9 100 100 @2 @3 @4 #you can see that I am defining 1st rectangle's size with columns @8 and @9 show rectangle @10 @11 100 100 @5 @6 @7 #the size is fixed for both (100 x 100) but you can alter this also readmouse l @1 3000 #and the color is defined with the final three information (@2-@4 for the 1st and clear screen #@5-@7 for the second) delay 300 #finally, I tell it that the @1 contains the information on which is the correct save STATUS RT UNDER_MOUSE #stimulus (1 and 2 refer to the order with which they are defined within a task)
block green tasklist green 5 end
Just replace rectangles with images, and You are good to go. The task was to click on the red square which is shown alongside the blue one... Hope the table and the task code are clear. Ask away if I haven't provided a clear code.
Best, Matia
|
|