|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 6/12/2008 3:28:06 PM
Posts: 6,
Visits: 29
|
|
I am conducting a Fitt's Law type of task and am having some difficulty with the timing. It appears that I am recording the reaction times for a trial correctly; however I need to record how long the cursor entered the target area prior to pressing the mouse button. It appeared to be working correctly; however about 3 out of every 110 trials I run results in a negative number. The rest of the recorded data appears to be in the area of what would be expected. To record the time that the cursor enters a target I am using: InTargetTime = clock.read - Test.starttime. Then to figure out how long the cursor was in the target prior to the button press I am using: c.SetAttrib "THT", Test.rt - InTargetTime. If anyone has any ideas it would be greatly appreciated. As of right now if the highlight time (THT) results in a negative I am counting that trial as incorrect and re-administering it, however this really doesn't make me feel confident in the overall accuracy of my THT variable.
Below I am pasting the full inline that I am using to process the mouse response in order to give this a little more context.
'Designate "theState" as the Default Slide State, which is the
'current, ActiveState on the Slide object "Stimulus"
Dim theTest as SlideState
Set theTest = Test.States("Default") 'Check for Edit
Dim strHitTest As String
Dim theMouseResponseDataTest As MouseResponseData
Dim targethit As Boolean
Dim slipcount As Integer
Dim ptMouse As Point
Dim InTargetTime As Long
'Constantly checking cursor position prior to pressing mouse button
While Test.InputMasks.IsPending()
Mouse.GetCursorPos ptMouse.x, ptMouse.y
strHitTest = theTest.HitTest(ptMouse.x, ptMouse.y)
If strHitTest = "Text2" and targethit = false Then
targethit = true
InTargetTime = clock.read - Test.starttime 'Necessary in determining the time it takes to click the button after entering target
end if
if strHitTest <> "Text2" and targethit = true then
targethit = false
Slipcount = Slipcount + 1
c.SetAttrib "Slip", Slipcount
end if
wend
'Get the mouse response
Set theMouseResponseDataTest = CMouseResponseData(Test.InputMasks.Responses(1))
'Determine string name of SlideImage or SlideText object at
'mouse click coordinates. Assign that value to strHit
strHitTest = theTest.HitTest(theMouseResponseDataTest.CursorX, theMouseResponseDataTest.CursorY)
'Compare string name where mouse click occurred to CorrectAnswer
'attribute on each trial, and score response
'NOTE: This comparison is case sensitive
If strHitTest = "Text2" Then
Test.ACC = 1
c.SetAttrib "THT", Test.rt - InTargetTime 'Records the amount of time the cursor was in the target prior to pushing the mouse button
c.SetAttrib "ReactionTime", test.rt
c.SetAttribAtSource "Correct", 1
Else
Test.ACC = 0 'Check For Edit
ErrorCount = ErrorCount + 1
c.SetAttrib "Error", 1
c.SetAttribAtSource "Correct", 0
End If
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Today @ 9:12:01 AM
Posts: 549,
Visits: 1,196
|
|
| I believe this is due to the calculation of your "in" time being based on the Test.StartTime. The RT values are based on the .OnsetTime of an object. The .OnsetTime is when an object draws or plays. The .StartTime is when the object's .Run call was entered. If the object takes any time to setup or has to wait for the vertical sync, then the .OnsetTime will be greater than the .StartTime and results in the .OnsetDelay value. When you have .OnsetDelay values you typically resolve this by setting the PreRelease of the previous object high enough to accomodate for it coupled with making your durations divisible by the refresh rate. However, the issue you have brought up should be resolved by using the .OnsetTime instead of .StartTime in your calculation. If you logged the .OnsetTime or .RTTime for your previous runs, you can adjust the "in" time by subtracting the values.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 6/12/2008 3:28:06 PM
Posts: 6,
Visits: 29
|
|
| Thank you so much. Changing to .onsettime appears to have fixed it.
|
|
|
|