Do nothing for clicking the "Default" area of a Slide

19 views
Skip to first unread message

PHILLIP M Mahoney

unread,
Aug 17, 2016, 12:54:19 PM8/17/16
to E-Prime
Hi all,
I'm having a really simple problem with a HitTest. Right now,I have a slide with two text boxes. If participants click on a textbox labeled "Text1," the box gets highlighted, the answer is logged as correct, and they go to the next trial. Similarly, if they click "Text2", the box gets highlighted, the answer is logged as incorrect and they go to the next trial. I want to add a third option: If they click anywhere on the slide other than "Text1" or "Text2", nothing should happen--nothing should be highlighted, no response should be logged, and the experiment should not advance to the next trial. 
So, the relevant code I'm using (which I basically took from other sources) looks like this:

Dim theState As SlideState
Set theState = Response.States("Default")
Dim theSlideText As SlideText
Dim StrHit As String
Dim intRating As Integer
Dim theMouseResponseData As MouseResponseData

If Response.InputMasks.Responses.Count > 0 Then
     
        Set theMouseResponseData = CMouseResponseData(Response.InputMasks.Responses(1))
   
        strHit = theState.HitTest(theMouseResponseData.CursorX, theMouseResponseData.CursorY)
        If Left(strHit, 4) = "Text" Then
   
       
              Set theSlideText = CSlideText(Response.States.Item("Default").Objects(strHit))
              theSlideText.BackColor = CColor("red")
       
              Response.Draw
        
              Sleep 500
              theSlideText.BackColor = CColor("gray")
              theSlideText.BackColor = CColor("white")
   
        Else??????
   
        End If

I have successfully used the redo stimulus option after "Else" by referring to a label, but I don't want to redo the stimulus. I just want nothing to happen.
I think the problem is with the Response.Count. I don't want just any click to register as a response. But maybe that is the wrong way to think about this problem.
Can anyone help?
Thanks in advance,
Phil
   
Reply all
Reply to author
Forward
0 new messages