Hello all,
I have been working on developing a cognitive task, that is slightly modified from the traditional dot-probe task. However, I use images instead of words, and the idea is to prompt the end user to use a mouse click to select the "positive image" (a positive image and negative image are presented simultaneously at the top and bottom of the screen, followed by a crosshair in the next frame, at the location where the positive image was previously presented). Because I am working with a cognitively impaired population, this task as a whole is supposed to be a low-cognitive load task (hence the use of images instead of words, and mouse clicks). While the code works fine, I have issues with moving the mouse back to center position, every time a choice is made. The mouse/cursor remains in the position where it was last clicked. I have tried to forcefully reset mouse position, looking at http://www.millisecond.com/community/forums/p/1293/3971.aspx#3971 and
http://www.millisecond.com/community/forums/p/2002/6738.aspx#6738 as examples, but I was wondering if there is any other way of bringing the mouse back to center position, without forcefully asking the end user to do so.
Any other suggestions would also be appreciated. I would like to keep it as simple as possible. If there is nothing else I can do, I suppose I will look at use keyboard keys.
Many thanks for all the help,
Corona
No, there is no alternative to the solution provided in the 1st thread you referenced, i.e., provide a centered object subjects need to click between your proper experimental trials.
Regards,
~Dave
"To understand recursion, you must first understand recursion." - Unknown Zen Master
Thanks Dave for the really quick response! I was wondering if using the first thread (as described in your answer), will increase the cognitive load, before I present each "active" stimulus frame. Would you rather suggest I just stick to keyboard keys whilst making choices? I am asking only for an opinion, since I am not able to judge which of the two options will weigh more heavily on cognitive load.
Hmm, offhand, keyboard input would seem more streamlined and straightforward to me (i.e., probably producing less cognitive load). However, that's just an opinion and I could be very wrong (knowing nothing about your target population). Perhaps do a pretest if your time and budget permit to compare the two options?
Okay, I tried to go with the forced re-set option, but it is not working. i.e., the stimulus is presented, but the center square doesn't show up.
Please let me know where I have gone wrong. This is just a sample code, the block will eventually consist of more and different trials.
Appended is my code:
<picture pleasanttoptarget>
/items = pleasant
/position = (50%,30%)
/size = (20%, 20%)
/select = noreplace
</picture>
<picture pleasantbottomtarget>
/position = (50%,70%)
<item pleasant>
/1 = "flower1.jpg"
/2 = "flower2.jpg"
/3 = "flower3.jpg"
/4 = "flower4.jpg"
/5 = "flower5.jpg"
/6 = "flower6.jpg"
/7 = "flower7.jpg"
/8 = "flower8.jpg"
</item>
<picture unpleasanttop>
/items = unpleasant
/size = (40%, 40%)
<picture unpleasantbottom>
/position = (50%,80%)
/size = (25%, 25%)
<item unpleasant>
/1 = "insect1.jpg"
/2 = "insect2.jpg"
/3 = "insect3.jpg"
/4 = "insect4.jpg"
/5 = "insect5.jpg"
/6 = "insect6.jpg"
/7 = "insect7.jpg"
/8 = "insect8.jpg"
<text focuspoint>
/items = ("_________________________________________________")
/color = (0, 255, 255)
/txbgcolor = (255,255,255)
/fontstyle = ("Arial", 30pt)
</text>
<text prompttop>
/items = ("+")
/position = (50%, 30%)
<text promptbottom>
/position = (0%, 0%)
<values>
/ x = 50%
/ y = 50%
/ score = 0
</values>
<trial toppleasant>
/stimulustimes = [1=focuspoint, pleasanttoptarget, unpleasantbottom]
/responsemode = timeout (2000)
/responsetrial = (anyresponse, promptresponsetop)
</trial>
<trial promptresponsetop>
/stimulusframes = [1=focuspoint, prompttop]
/inputdevice=mouse
/validresponse = (pleasanttoptarget, unpleasantbottom)
/correctresponse = (pleasanttoptarget)
/ontrialend = [values.x=trial.promptresponsetop.responsex; values.y=trial.promptresponsetop.responsey]
/ontrialend= [if (trial.promptresponsetop.correct == 1) {values.score = values.score + 1}]
/responsetrial = (pleasanttoptarget, musicoftriumph)
/ responsetrial = (unpleasantbottom, centermouse)
<video mymusic>
/items = ("YanniAcroyali.mp3", "Yanni_Tribute_edited.mp3")
/playthrough = true
</video>
<trial musicoftriumph>
/stimulustimes = [1=focuspoint, mymusic]
/ timeout = 1
/responsetrial = (noresponse, centermouse)
<shape centersquare>
/ shape = rectangle
/ size = (20px, 20px)
/ position = (50%, 50%)
</shape>
<trial centermouse>
/ stimulusframes = [1=centersquare]
/ inputdevice = mouse
/ validresponse = (centersquare)
<block practice>
/trials = [1-3 = noreplace(toppleasant)]
</block>
<data>
/columns = [date time subject trialnum trialcode latency response values.score values.x values.y]
</data>
It's showing up just fine. Attached is a screenshot generated via the /screencapture attribute in <trial centermouse>.
P.S.: Please consider using the forum's file attachment facility (see the 'Options' tab when posting to a thread) instead of pasting long scripts into the message body (which does not serve readability well, nor does it make it easy to actually run your code). Also, for scripts that require external files to function, please either provide those files too, or remove any dependencies for external files from your code prior to posting. Thanks.
Thanks Dave. I did not know about the upload option, and for future codes, will use it for your convenience. The square shows up when I select the correct option (that is, when I click on the region where the crosshair appears, but fails when I choose the incorrect option).
Specifically, it fails here (or at least, that is my understanding):
Hi Dave,
I made a slight change :
/branch= [if (trial.promptresponsetop.correct == 0) trial.centermouse]
No, works for both options. Although it actually shouldn't work for either of the two options, since the objects defined as responses are *not* actually available in the respective <trial> supposed to collect the response:
<trial promptresponsetop>/stimulusframes = [1=focuspoint, prompttop]/inputdevice=mouse/validresponse = (pleasanttoptarget, unpleasantbottom)/correctresponse = (pleasanttoptarget)/responsemode = timeout (2000)/ontrialend = [values.x=trial.promptresponsetop.responsex; values.y=trial.promptresponsetop.responsey]/ontrialend= [if (trial.promptresponsetop.correct == 1) {values.score = values.score + 1}]/responsetrial = (pleasanttoptarget, musicoftriumph)/responsetrial = (unpleasantbottom, centermouse)</trial>
No 'pleasanttoptarget', no 'unpleasantbottom' in the trial's /stimulusframes. Can't click on an object that isn't there. You'll want to merge those two <trial> elements:
<trial toppleasant>/stimulustimes = [1=focuspoint, pleasanttoptarget, unpleasantbottom]/responsemode = timeout (2000)/responsetrial = (anyresponse, promptresponsetop)</trial><trial promptresponsetop>/stimulusframes = [1=focuspoint, prompttop]/inputdevice=mouse/validresponse = (pleasanttoptarget, unpleasantbottom)/correctresponse = (pleasanttoptarget)/responsemode = timeout (2000)/ontrialend = [values.x=trial.promptresponsetop.responsex; values.y=trial.promptresponsetop.responsey]/ontrialend= [if (trial.promptresponsetop.correct == 1) {values.score = values.score + 1}]/responsetrial = (pleasanttoptarget, musicoftriumph)/responsetrial = (unpleasantbottom, centermouse)</trial>
into a single <trial>. The separation strikes me as unnecessary.Regards,~Dave
I had initially merged the two trials, but the crosshair (which should be presented after the two images come up on the screen) showed up on top of the positive image. Once I separated the two trials, I was able to overcome this problem.
A portion of the code - modified according to your suggestion, is as follows:
/stimulustimes = [1=focuspoint, pleasanttoptarget, unpleasantbottom; 500=prompttop]
/ontrialend = [values.x=trial.toppleasant.responsex; values.y=trial.toppleasant.responsey]
/ontrialend= [if (trial.toppleasant.correct == 1) {values.score = values.score + 1}]
/branch= [if (trial.toppleasant.correct == 0) trial.centermouse]
Corona21:I had initially merged the two trials, but the crosshair (which should be presented after the two images come up on the screen) showed up on top of the positive image
You need to review the "How to erase stimuli" topic in the Inquisit documentation.
Corona21:the idea is that the participant need not have to EXACTLY click ON the crosshair. He/She is free to click on any region occupied by the previous image
Then simply *put* a bunch of objects (e.g. <shape> or <text> elements) there which occupy your ROIs (i.e., appropriate /size and /position) and define those as valid responses, one of them as correct response. They need not be visible, i.e., set their color to be identical to the screen's background color.
Thank you for your response. I have incorporated much of what you suggested, and my finalized code is available here:
http://www.millisecond.com/community/members/Corona21/default.aspx (I am guessing you will be able to view the files I uploaded, including all media/image files).
I am however having trouble on two accounts:
1)I would prefer if the mouse/cursor shows up only when the crosshair or black square at the center of the screen shows up. I do not want the cursor to show up when the two stimuli (images) are presented. I have not been able to achieve (of course, an err in my logic!) with /showmycursor = false. When I place this statment at the end of each trial (/ontrialend = [showmycursor = false]), when the block runs the trials the second time, the cursor simply disappears for all trails henceforth.
2)I am also having trouble with the data columns. Is it possible to directly load the data onto an excel sheet ? When it gets loaded into the default .dat (txt) file, the columns are not of fixed width (delimited only by tabs), and data values run all over.
Please let me know where I have gone wrong.
Also, I hope I uploaded the files in the correct location!
Thanks,
Corona21
Corona21:1)I would prefer if the mouse/cursor shows up only when the crosshair or black square at the center of the screen shows up
That's not possible in the current single-trial setup, unfortunately. If this is an absolute *must* the only option is to go back to daisy-chaining two separate <trial> elements, the first <trial> displaying the pics, lasting 5000ms, taking no input and set to /inputdevice=mousekey or keyboard. The second <trial> displaying the probe, etc., collecting the response, set to /inputdevice = mouse.
Corona21:2)I am also having trouble with the data columns. Is it possible to directly load the data onto an excel sheet ? When it gets loaded into the default .dat (txt) file, the columns are not of fixed width (delimited only by tabs), and data values run all over.
Excel will open tab-delimited files just fine.
Corona21:Also, I hope I uploaded the files in the correct location!
Next time simply put them all in a single zip file and upload the archive.
A copy of my file is attached.
Thank you for the prompt reply Dave. Will check!