Conditional Statement with terminate action
E-Prime Version (2.0)
I have an experiment in which the subject has to use the mouse and select a picture from a pool of images. These images are arranged on a slide object and I've found this script for collecting the sub-object name:
'Designate "theState" as the Default Slide State, which is the
'current, ActiveState on the Slide object "Stimulus"
Dim theState As SlideState
Set theState = Test.States("Default")
Dim strHit As String
Dim Response As String
Dim theMouseResponseData As MouseResponseData
'Was there a response?
If Test.InputMasks.Responses.Count > 0 Then
'Get the mouse response
Set theMouseResponseData = CMouseResponseData(Test.InputMasks.Responses(1))
'Determine string name of SlideImage or SlideText object at
'mouse click coordinates. Assign that value to strHit
strHit = theState.HitTest(theMouseResponseData.CursorX, theMouseResponseData.CursorY)
Test.Tag = c.GetAttrib(strHit)
End If
However, if my subject click on an area in which there is not an image, the experiment crash. I would like to have a situation in which:
- If the subject click on an image -> collect the image name and go to the next trial
- If the subject click on other areas -> do nothing and stay in the same trial until an appropriate area is clicked.
How can I do?
Please sign in to leave a comment.
Comments
1 comment