strHit not returning correct answer

Ren gidgetownsme at gmail.com
Tue Feb 7 17:31:01 UTC 2012


Yes! That's exactly what fixed it. I tried subbing out all different
parts of my program, but that didn't even occur to me.

Thanks!

On Feb 6, 4:11 pm, ben robinson <baltimore.... at gmail.com> wrote:
> have you tried using Debug.Print to help you figure out what value
> strHit actually has following a mouse click?  i think you'll find that
> strHit="SlideText1" or something like that, rather than "BLUE".
> strHit only tells you the name of the object clicked, not what text is
> actually displayed by that object.
>
> ben
>
>
>
>
>
>
>
> On Mon, Feb 6, 2012 at 3:58 PM, Ren <gidgetown... at gmail.com> wrote:
> > 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 athttp://groups.google.com/group/e-prime?hl=en.

-- 
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