|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/2/2008 11:58:35 AM
Posts: 23,
Visits: 53
|
|
Does anyone know how use the response data from the SR Box in an InLine script?
In order to collect mouse response data I know you use the 'hitTest' but what about for the SR Box?
Basically what I want to do is write something like this:
If c.GetAttrib("CorrectAnswer") = *SRBox input* then ....
but I do not know how E-Prime refers to the SRBox input.
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Yesterday @ 3:05:40 PM
Posts: 569,
Visits: 1,237
|
|
| You are on the right track. The Object.InputMask.Responses collection holds an array of all responses made by the object. If subject made a mouse and srbox response, the Object.InputMask.Responses.Count property would be = 2. All items in the Object.InputMask.Responses are of type ResponseData. However, you can cast (ask) the item if it is of a specific type such as SRBOX or Mouse. When you use the casting functions, if the item is not of that type it returns you Nothing which will cause a runtime error if you try to use it. In your specific example, the code you might want to look into is... (Replace STIMULUS with the name of your object) 'Were there enough responses If Stimulus.InputMasks.Responses.Count = 2 Then 'Get the first response Dim theMouseResponseData As MouseResponseData Set theMouseResponseData = CMouseResponseData(Stimulus.InputMasks.Responses(1)) 'Is it a mouse? If Not theMouseResponseData Is Nothing 'Get the second response Dim theSRBoxResponseData As SRBoxResponseData Set theSRBoxResponseData = CSRBoxResponseData(Stimulus.InputMasks.Responses(2)) 'Is it a SRBox? If Not theSRBoxResponseData Is Nothing 'Did we match the correct answer? If theSRBoxResponseData.RESP = c.GetAttrib("CorrectAnswer") Then 'Assign the correct ACC Stimulus.ACC = 1 End If End If End If End If -Brandon
|
|
|
|