|
Post by SemperLupe on Jul 14, 2020 10:43:02 GMT
Hi all, I just cannot get this coding done... I am trying to set up a task where a participant will see a fixation mark for 220ms, followed by a word (for example DOG) for 2 seconds, followed by 4 images (1 in each corner) - the 4 images I have put on a 1-image file (so I upload one bitmap and you see 4 different images on a white background). The idea is that they have to press one of four keys (c e m i) depending on which image corner the word you just read corresponds with. So if the word is CAT and the cat show in the top left corner, I would expect them to press E. I need the code to wait until they press one of those four keys until they see a fixation mark again for the next word + images. I need to record accuracy (when they pressed the key corresponding with the right image) and reaction time in ms. Can someone please help me?? This is what I've got so far: options fullscreen background color white bitmaps fixation_mark image1WORD (this is the word dog)
image1 (this is the image with four images in each corner, the top left being a dog)
image2 image3 image4 image5 image6 image7 image8 image9 task WordPicture keys c e m i show bitmap fixation_mark delay 200 show bitmap image1 readkey 2 3000 block WordPicture bitmap fixation_mark wait_for_key tasklist WordPicture 1 end With this code, all I get is the fixation mark and it doesn't move onto anything else...
|
|
|
Post by SemperLupe on Jul 14, 2020 10:49:23 GMT
Ok so I've got the fixation_mark bitmap up when I start the experiment. Then it will only move on to the next image (the word) when I click the space bar...this needs to happen automatically after 2 seconds.
|
|
|
Post by alexandra (AEC) on Jul 14, 2020 13:27:10 GMT
Hi there,
this might be a stupid question, but why do you need to show a fixation before your task (in your block) while waiting for a key press and then show another fixation again in each trial (see task)? If your concern is in regards to the fixation in your block, then you need to remove the wait_for_key command and replace it with delay 2000. This will show the fixation only once before your task.
In order to record correctness of an answer, I recommend creating a table including the bitmap names and the corresponding key number (following the order presented in your task, c would be 1, for example).
In order to save the correctness of the response and the response time, I recommend to add the following to your code:
task WordPicture keys c e m i show bitmap fixation_mark delay 220 # changed in accordance with your description clear -1 # I assume you do not want the fixation and the word together on the screen? show bitmap image1 readkey @2 3000 # assuming the correct key number is in the second column of your table (@2 referes to this) clear -1 save BLOCK STATUS RT # you will now be able to save the status (correct = 1, wrong = 2 or too late = 3) and reaction time
|
|
|
Post by SemperLupe on Jul 23, 2020 13:43:51 GMT
Hi Alexandra, Thank you so much for your response! I was just being a bit stupid myself! The wait_for_key wasn't meant to be in the block. I removed it and it works just fine now It's now task WordPicture keys c e m i show bitmap fixation_mark delay 1000 # 1 sec so my participants don't go crazy clear - 1 show bitmap image1 readkey 2 6000 # I didn't use a table as I found out about this way later lol - I'm a complete beginner clear -1 save STATUS RT
|
|
|
Post by SemperLupe on Jul 23, 2020 13:44:32 GMT
The block is simply
block WordPicture tasklist WordPicture 1 end
|
|
|
Post by francine on Aug 5, 2020 22:08:11 GMT
Hi There,
I am having a similar problem with my experiment. I have uploaded the images I need to the folder, but I keep getting the error message below. I keep trying reviewing the tutorial and have tried uploading the images in different formats (svg instead of jpg), but I keep getting the same error message. Kindly advise, what am I missing?
Compiler errors (note: survey will not work with errors): You need to fix the mistakes, otherwise the experiment part of the survey will result in a error message, and participants will be not be able to complete the survey.
Unknown survey command: bitmaps
Unknown survey command: GreenCong
Unknown survey command: BrownCong
Unknown survey command: PurpleCong
Unknown survey command: WhiteCong
Unknown survey command: YellowCong
Unknown survey command: RedCong
Unknown survey command: BlueCong
Unknown survey command: OrangeCong
Unknown survey command: PinkCong
Unknown survey command: task
Unknown survey command: show
Unknown survey command: delay
Unknown survey command: clear
Unknown survey command: delay
Unknown survey command: show
Unknown survey command: clear
|
|
|
Post by alexandra (AEC) on Aug 6, 2020 8:27:37 GMT
Hi there,
how have you defined the images under bitmaps? In the case of png you do not need to do anything else but state the name of the image. In the case of jpg or any other type you will need to state the whole file name after you stated the image name, e.g image name is "cat" and the type is a jpg you would need to write
bitmaps cat cat.jpg
If you have the images not in the same folder as the experiment like some examples show, which have a separat folder for the images called "stimuli", you will also need to state in options where the images can be found
options bitmapdir stimuli
|
|
|
Post by PsyToolkit on Aug 8, 2020 17:05:10 GMT
And in the 3.1.1 (current version) you do not even need to say the type, so it does not matter if it is png or jpg etc.
For example, you have a file uploaded that is called cat.jpg
You would "define" this as follows:
bitmaps cat
task some_task show bitmap cat
|
|