DoHitTest & Multiple SlideStates

Susan G. Campbell scampbell at casl.umd.edu
Mon Jul 14 20:15:42 UTC 2008


Hi Dina,

I'll take a wild guess here, based on your code sample and answers.  I
think David probably solved the SlideState problem, and this is
something else. I'm a little rusty at debugging other people's E-Basic,
so I may be way off.  From this code snippet:

	Select Case strHit

	Case "UpperLeft"
		c.setattrib "CorrectAnswer", 1
	Case "UpperRight"
		c.setattrib "CorrectAnswer", 2
	Case "BottomLeft"
		c.setattrib "CorrectAnswer", 3
	Case "BottomRight"
		c.setattrib "CorrectAnswer", 4
	Case Else
		Goto Label3

	End Select

It looks like what you're setting based on what the participant hits
isn't Motor.RESP but CorrectAnswer -- so it's changing the correct
answer based on what the participant answers, and not setting Motor.RESP
to anything (so it'll always be 1, corresponding to the left mouse
button as Ben said).  

Then in your comparison, you're comparing strHit (which is, I'm guessing
based on your case statement above, a string with content like
"UpperLeft") to CorrectAnswer (which is a number).  That's always going
to be false.  I'm not sure why CorrectAnswer isn't the name of the
object they should click on, but that's what this comparison assumes is
going on:

If strHit = c.GetAttrib ("CorrectAnswer") Then
		Motor.ACC = 1
	Else
		Motor.ACC = 0
	End If

You should be able to verify the content of these variables with the
judicious use of Debug.Print, though.  

Hope this helps,
Susan

-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On
Behalf Of Dina
Sent: Monday, July 14, 2008 3:41 PM
To: E-Prime
Subject: Re: DoHitTest & Multiple SlideStates


Hi David,

Thanks for your suggestion!
I tried it out and the programme does run, but still does not log the
responses appropriately.
I acted like the perfect participant and made no errors.

This is what the output says:

Trial 1

CorrectAnswer: 1
StateName: UL
Motor.ACC: 0
Motor.RESP: 1

Trial 2

CorrectAnswer: 3
StateName: BL
Motor.ACC: 0
Motor.RESP: 1

Trial 3

CorrectAnswer: 2
StateName: UR
Motor.ACC: 0
Motor.RESP: 1

What I also noticed is that Motor.ACC = 0, even for the first trial.
I'm not sure how this can be solved.

Dina

David McFarlane wrote:
> Dina,
>
> >How can I modify the script in such a way that every response, no
> >matter what SlideState, will be logged appropriately?
>
> Your code fragment was very helpful.  Just a guess, since I have not
> used DoHitTest and I did not test this with sample code, but based on
> my understanding I would say the problem is with
>
> >Set theState = Motor.States ("UL")
>
> since this always refers just to your UL state.  Instead, try
>
> Set theState = Motor.States (Motor.ActiveState)
>
> and see if that helps.
>
> -- David McFarlane, Professional Faultfinder


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