Setting mouse response options
Francisco Tornay
ftornay at ugr.es
Thu Nov 14 19:28:18 UTC 2002
Hi all,
You may remember that Catherine Ortner submitted to this group a question
about setting response mouse option. I came up with one solution: repeating
the slide object while no allowable zone was clicked by jumping to a label
before the slide object. However, I later told Catherine a possible
drawback. Every time you run a new instance of the the slide object and,
therefore, reset the RT counter. I wrote to Catherine about a possible way
around the difficulty.
Now I'm submitting the solution to the group, so that you all can check
it and decide whether I did something wrong (I hope not).
Thank you in advance.
This is what I wrote to Catherine:
One solution is to keep a running sum of the different RTs calculated at
each repetition of the slide object. One should also take into account the
time elapsed during the inline processing that decides whether or not
repeat the slide. This may be confusing. I would advise you to do the
following:
a) go to the user tab in the script window and declare new variables:
'Variables to calculate the real RT
dim lngCurrentTime as long
dim lngAccRT as long
b) insert a new inline object before the "again" label with the following line:
lngAccRT = 0 'Resets the accumulated time
c) Modify the inline object after the slide object this way (I am calling
the slide object "stimulus" and the slidestatus "default", change them to
the names you are using).
' Calculate the current time
lngCurrentTime = clock.readmillisec
'Variable that stores the mouse response
dim rdMouse as MouseResponseData
'Variable that stores the clicked area
dim strhit as string
' Determine the clicked area (Right, Left or none)
Set rdMouse = CMouseResponseData(Stimulus.InputMasks.Item(1).Responses(1))
strhit = Stimulus.states("default").hittest(rdMouse.CursorX, rdMouse.CursorY)
'If you get an empty string no allowable area was selected
if strhit = "" then
'In that case accumulate the elapsed RT along with the time taken so far by
this inline
lngAccRT = lngAccRT + Stimulus.RT - lngCurrentTime + clock.readmillisec
'and repeat the slide object
goto again
end if
'If you get here it's because an allowable zone was clicked
'So handle the mouse response. This is an example, if you have already
written the code
'you don't need to change it. I am assuming that the name of the current
correct area is stored
'in the "CorrectAnswer" attribute, which contains either Left or Right
if strhit = c.getattrib("CorrectAnswer") then
Stimulus.acc = 1
else
Stimulus.acc = 0
end if
'Now you may want to store the clicked area in an attribute
c.setattrib "SlideResponse", strhit
'This line would store the right reaction time in a new attribute called
"RealSlideRT"
'You should use this variable rather than stimulus.RT for analysis.
c.setattrib "RealSlideRT", lngAccRT + Stimulus.RT
Try this several times and play a little with the RT and the responses you
make. Then compare the stimulus.RT and the RealSlideRT variables. You have
to decide whether the results are trustworthy (they should be).
You also may want to use the right reaction time for feedback by writing
[RealSlideRT] instead of @RT. By using both while you are checking this you
can see what's going on a trial by trial basis.
If you have any problem feel free to ask
Francisco
More information about the Eprime
mailing list