max count interfers with free operant task
free_operant_task
hollysully at gmail.com
Thu Sep 20 16:39:22 UTC 2012
Hi,
I am trying to create a free operant task in which multiple button presses
are rewarded at a variable rate. I have inserted the sample script from the
eprime website that collects the RESP and RT for multiple responses; on its
own, this is working well and collects data for each response according to
the "max count" for the stimuli and after the max count is reached, the
trial moves on to the feedback.
However, I want the rate of presses to be rewarded (move to the feedback
object) at a variable, random (between 1 & 20) rate of presses. To
accomplish this, I have tried adding an inline script before the stimuli,
which generates a random number and an inline script after the stimuli
(below the script that collects multiple responses taken from the eprime
website) with a loop that requires repeated button presses until the number
of button presses equals the random number (generated on the inline before
the stimuli) and then the trial moves to the feedback. The loop is working
in and of itself but only if the "max count" is set to 1. When I try to
increase the max count, or when I try to make the max count reference the
random number attribute (generated before the stimuli), then my script
stops working.
Any help would be greatly appreciated! Here is a screen shot of the trial
structure and a copy of the second inline code. Everything within the two
long lines is taken from the eprime website; below the line is the bit of
code I added.
*
___________________________________________________________________________________________
*
Dim theResponseObject As RteRunnableInputObject
Set theResponseObject =
CRteRunnableInputObject(Rte.GetObject("FreeOperantFrac"))
'If the assert below fires, then the object named in the line above
does not exist
Debug.Assert Not theResponseObject Is Nothing
'Counter variable for the number of responses made
Dim nPressCount As Long
'Counter variable
Dim nIndex As Integer
'Used to set attributes for statistics
Dim strStatistic As String
'Enumerate through the response collection
'If any of the responses were made by the keyboard, display
'the statistics to the user.
For nIndex = 1 To theResponseObject.InputMasks.Responses.Count
'Set theKeyboardResponseData equal to the current keyboard response
Dim theKeyboardResponseData As KeyboardResponseData
Set theKeyboardResponseData =
CKeyboardResponseData(theResponseObject.InputMasks.Responses(nIndex))
If Not theKeyboardResponseData Is Nothing Then
'Increment the press count
nPressCount = nPressCount + 1
'Log reaction time and response for each key press.
c.SetAttrib "KeyPress" & nIndex & "RT",
theKeyboardResponseData.RT
c.SetAttrib "KeyPress" & nIndex & "RESP",
theKeyboardResponseData.RESP
End If
Next 'nIndex
*
___________________________________________________________________________________________
*
Do
If nPressCount <> RewardProb Then
GoTo Label2
End If
Loop Until (nPressCount = RewardProb )
If nPressCount = RewardProb Then
GoTo RewardLabel
End If
--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/e-prime/-/XZe94LfKmBoJ.
For more options, visit https://groups.google.com/groups/opt_out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20120920/26d87738/attachment.htm>
More information about the Eprime
mailing list