max count interfers with free operant task
free_operant_task
hollysully at gmail.com
Mon Sep 24 00:28:43 UTC 2012
Thanks a lot for the reply David! That worked exactly--thanks for helping
me clarify what I needed to do.
~Holly
On Thursday, September 20, 2012 3:25:51 PM UTC-4, McFarlane, David wrote:
>
> Well, just reading this over, and based upon your earlier post, I
> gather that all you really want to do is vary MaxCount based on some
> computation, is that right? Then why not do it simply with an
> attribute reference? E.g., in the Advanced input mask properties for
> you stimulus object, for MaxCount enter "[MaxCount]". Then, in
> inline code just before your stimlus, put something like
>
> c.SetAttrib "MaxCount", your_computed_value_goes_here
>
> I had never thought before about controlling MaxCount through an
> attribute reference myself, so before I wrote this I tested it to
> make sure it all works, and it does. So thanks for posing this.
>
> -----
> David McFarlane
> E-Prime training
> online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
> Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)
>
> /----
> Stock reminder: 1) I do not work for PST. 2) PST's trained staff
> take any and all questions at
> http://support.pstnet.com/e%2Dprime/support/login.asp , and they
> strive to respond to all requests in 24-48 hours -- this is pretty
> much their substitute for proper documentation, so make full use of
> it. 3) In addition, PST takes questions at their Facebook page
> (http://www.facebook.com/pages/Psychology-Software-Tools-Inc/241802160683
> ), and offers several instructional videos there and on their YouTube
> channel (http://www.youtube.com/user/PSTNET ) (no Twitter feed yet,
> though). 4) If you do get an answer from PST staff, please extend
> the courtesy of posting their reply back here for the sake of others.
> \----
>
>
> At 9/20/2012 12:39 PM Thursday, free_operant_task wrote:
> >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/-/wXSW94iwQOQJ.
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/20120923/f3bb9197/attachment.htm>
More information about the Eprime
mailing list