strHit not returning correct answer

Ren gidgetownsme at gmail.com
Mon Feb 6 20:58:08 UTC 2012


Hello,

I am trying to build a program to use a mouse click to select a
correct answer, which is pulled from the TrialList. Something is wrong
in that the program doesn't seem to find anything to match the
"Correct Answer" category, and always returns a negative result. I am
using this code:


'Designate "theState" as the Default Slide State, which is the
'current, ActiveState on the Slide object "Stimulus"
Dim theState as SlideState
Set theState = SLIDENAME.States("SLIDESTATENAME")

Dim strHit As String
Dim theMouseResponseData As MouseResponseData

'Was there a response?
If SLIDENAME.InputMasks.Responses.Count > 0 Then

'Get the mouse reponse
Set theMouseResponseData =
CMouseResponseData(SLIDENAME.InputMasks.Responses(1))

'Determine string name of the SlideImage or SlideText object at
'mouse click coordinates. Assign that value to strHit
strHit = theState.HitTest(theMouseResponseData.CursorX,
theMouseResponseData.CursorY)

'Compare string name where mouse click occured to CorrectAnswer
'attribute on each trial, and score response
'NOTE: This comparison is case sensitive
If strHit = c.GetAttrib("CORRECTANSWERCOLUMN") Then
SLIDENAME.ACC = 1
Else
SLIDENAME.ACC = 0
End If


End If
c.SetAttrib "Response", strHit

I have tried putting a text box on my slide with a word such as
"BLUE", then listing BLUE under the correct answer column and it still
will not return a correct response. I have also tried using images and
renaming most of the items on the slide to try to isolate the problem,
but nothing has worked. My mouse is turned on and the correct response
is [CORRECTANSWERCOLUMN] and allowable response {ANY}.

Any ideas? Using a mouse is essential because this will be a touch
screen program used with non-human primates. I've submitted this to
PST support, but it's been a few days and I would really like to get
this program up and running.

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list