Logging Multiple cursor_roi to same var & randomize image position
Dear Community,
I am creating an image recognition memory task, where participants are presented with 12 images (targets) to memorize (with simultaneous music) (coroutine: sketchpad and sampler). Immediately after the encoding phase, the initial 12 target images are shown with additional 12 distractors on a sketchpad and participants are asked to click the images they have memorized. (Sidenote: Participants Gaze is recorded during the encoding as well)
Now I have two problems arising for which I cannot find the solution from the forum or the tutorials. First I need to be able to log the names of all the clicked images. I managed to collect one image name in the cursor_roi variable. I have seen in a forum question, that it is necessary to have a mouse response item for each click, however, I only have one cursr_roi which only collects the name of one clicked object regardless of the amount of mouse_response items I use, so every entry is replaced by the latest cursor_roi entry. Further I do not want to advance to the next trial after one or more clicks rather by button press or keypress, right now it advances after one or more clicks (depending on the amount of mouse response items) Would anyone have an idea to log multiple clicked items from a sketchpad? All elements are named (e.g [target_1]) I have tried different ways using forms and image buttons, mousetrap and normal mouse response, but I feel I have overseen a simple solution.
The second problem is that I need to randomize the image positions in both the encoding and recall presentation. Shuffle_horiz for the individual columns does not work, as I then lose track of which image was a target and a distractor, or I can only shuffle within the distractors or the targets, but then distractor and target placeholders still remain at their place and it is not completely random. I have tried the python inline script from the visual search tutorial, using xy_grid insted of xy_circle, but that does not seem to work. When I got it running it presented all images at origin (0,0).
Would someone have an idea or experience with a similar task? Thank you in advance for any advice!
Best regards
David
Attached is the structure tree of my setup. I am running Open Sesame 3.3.10.
Comments
I have tried an inline script, in the hope that each clicked item (item name) will be appended to my variable, if I cannot get it to append to cursor_roi. Is that a reasonable approach?
I am quite new to python as one might be able to tell :)
Hi David,
Would anyone have an idea to log multiple clicked items from a sketchpad?
one alternative would be to wrap the clicking and presenting into a loop, but how to coordinate clicking and pressing a key is not trivial. I'm not familiar enough with mousetrap. @Pascal can mousetrap help in this situation?
In any case, I feel like the easier solution would be to implement your experiment with inline_scripts with Python. That way you have more control over which variables are logged, the consequences a certain action has and what things happen in parallel.
When I got it running it presented all images at origin (0,0).
Yeah, that's not what is supposed to happen. Randomization is actually also quite easy with Python (once you get the hang of it of course.
I am quite new to python as one might be able to tell :)
Have you seen the Python tutorials that are linked in the documentation? They're quite useful to get started.
Generally, it seems like you'll benefit most if you implement the task with inline_scripts. I attach a very basic example that outlines the approach somewhat (in Pseudocode). I hope it will help getting started. If you get stuck, report back here and share the code you have used so far, then I can try to give you more specific help.
Good luck,
Eduard
Dear Eduard,
thank you for your reply! The python tutroials indeed provide a good start into Python.
Concerning the implementation of the response collection, the professional support team has provided us with a soulution, indeed using an inline script. As far as I understand, an image button iteratively loading from the file pool acts as the reponse collection inside a python inline script, logging all responses until a break occurs when the next button is pressed. This works fine for our purposes and got the experiment running.
Thanks again for your advice.
Best regards
David
Dear David,
Great that you have a solution now. Just wanted to add for completeness that collecting both key press and clicking would not have been possible so I also believe that Python inline scripts are the way to go.
Best
Pascal
Dear Pascal,
thank you for your additions, thats good to know for the next time!
All the best
David