Tips needed for tweaking the standard likert scale script

Micah ucfmicah at gmail.com
Thu Jul 21 18:07:30 UTC 2011


Great advice- there are a few problems however;

1. The second solution actually breaks the slider. It appears if you
set the duration in the properties page, this prevents the loop from
"animating" the slider properly. It just stays stuck at the default
position and then selects that as the rating when the duration runs
out. I can't figure this one out, so on to solution 1

2. Inserting that line of code does not seem to do anything. To make
sure, I set the duration variable to 10000, and it was terminating
instantly after making a selection.

I'm thinking that the best option might be to put a textobject
immediately after the slideobject (i.e. "Stimulus") that presents the
scale, where the duration is set to 6000-stimulus.duration. I'll see
if I can do that now.

P.S. I can easily log non-responses, but it's trickier to log
responses where they move the slider but never confirm. The .resp show
sup as (for example) =11223, or =11113 for confirmed responses, but
=1112 etc for non-confirmed. Is there a function to search a stored
variable for a specific number? I tried setting the "allowed" in the
advanced collection options to [allowed], where allowed is a list
variable with 3 in each row. This would have been perfect, as if it
only logs "3"s then I have my solution. Seems weird they give us this
option if it doesn't work (it didn't seem to change the logs at all).

BW,
Micah

On Jul 21, 7:37 pm, David McFarlane <mcfar... at msu.edu> wrote:
> Micah,
>
> 1. Indeed, you do need to "make some kind of check, so that if it
> times out, it sets the value to NaN/etc."  I think you can manage
> that without me.
>
> 2. Oops.  First, I have to correct something I implied about my
> second solution (PreRelease >= Duration), namely, the second solution
> should already solve what you want to do here.  The second solution
> would have been a problem if you *did* want a response to move on to
> the next stimulus.  Even after the offset of a stimulus, the next
> stimulus will not run until it reaches the NextTargetOnsetTime (see
> the GetNextTargetOnsetTime and SetNextTargetOnsetTime topics in the
> E-Basic Help facility).  (This, BTW, is how PreRelease
> works.)  Because the second solution automatically sets
> NextTargetOnsetTime to, say, 6000 ms from the OnsetTime (or
> TargetOnsetTime, depending on Timing mode) of the scale, even after
> the scale code loop ends the next stimulus will not run until it
> reaches that NextTargetOnsetTime.  Savvy?  Better yet, try this and
> see if I know what I am talking about :).
>
> But back to the first solution.  Your modification is what almost
> anyone would come up with and in many cases is Good Enough, although
> you may get some slop of a ms or so every once in a while.  If you
> still want something a little tidier, and absolutely precise, then
> instead of a Sleep, I would simply do one of the following (depending
> on desired Timing mode) at *any* time either before or after the loop:
>
> SetNextTargetOnsetTime Stimulus.OnsetTime + Stimulus.Duration  ' use
> this for Event timing mode
>
> - or -
>
> SetNextTargetOnsetTime Stimulus.TargetOnsetTime +
> Stimulus.Duration  ' use this for Cumulativetiming mode
>
> If you followed the earlier discussion, you will see that this just
> expictly does in code what E-Prime would have done for you
> automatically using the second solution.  As a result, I much prefer
> following the second approach myself, leveraging the features built
> into E-Prime, but that does require deeper understanding of the
> architecture of E-Prime.  Mere mortals must stick with the first
> approach and write more code.
>
> -- David McFarlane, Professional Faultfinder
>
>
>
>
>
>
>
> >Thank you Todd [sic -- should be David]! That's an excellent
> >solution. I knew I'd need to
> >somehow do a clock read and feed that into the loop, but I wasn't able
> >to quite get there. Not to tax you, but there are two unresolved
> >issues with this solution-
>
> >1. The scale now records wherever the 'slider' is when the time limit
> >ends. I think it's probably much safer to record these as no response,
> >and I'm not sure how to manipulate the loop do so. I need to make some
> >kind of check, so that if it times out, it sets the value to NaN/etc.
>
> >2. The scale still ends immediately if a response is made. I've worked
> >out a way to stop that- by adding:
>
> >dim responsetime as integer
>
> >....... (the loop)
>
> >...bottom of the inline:
>
> >responsetime=Stimulus.RT
>
> >Sleep 6000-response time
>
> >However, I don't think that is compatible with your solution.
>
> >BW,
> >Micah
>
> >On Jul 21, 5:59 pm, David McFarlane <mcfar... at msu.edu> wrote:
> > > Stock reminder:  1) I do not work for PST.  2) PST's trained staff
> > > takes any and all questions
> > athttp://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) If you do get an answer from PST Web Support, please extend
> > > the courtesy of posting their reply back here for the sake of others.
>
> > > That said, here is my take...
>
> > > Try replacing
>
> > > Do While Stimulus.InputMasks.IsPending()
> > >     ...
>
> > > with something like
>
> > > Const  StimulusDur as Long = 6000
> > > Dim  StimulusTargetOffsetTime as Long
> > > StimulusTargetOffsetTime = Clock.Read + StimulusDur
> > > Do While (Stimulus.InputMasks.IsPending() and _
> > >      (Clock.Read < StimulusTargetOffsetTime) )
> > >      ...
>
> > > Alternatively, if you prefer to set stimulus duration in its Property
> > > Pages instead of with an InLine constant, then set both Duration and
> > > PreRelease to 6000 (in this case), and E-Prime will automatically
> > > compute the TargetOffsetTime for you, so the code simplifies to
> > something like
>
> > > Do While (Stimulus.InputMasks.IsPending() and _
> > >      (Clock.Read < Stimulus.TargetOffsetTime) )
> > >      ...
>
> > > Of course, you will find confusion either way.  For the first way,
> > > any time you want to change stimulus duration you will have to
> > > remember to dive into the code.  For the second way, you can change
> > > stimulus Duration in the normal way, but then you have to remember to
> > > always change PreRelease to the same thing (or, be daring and set
> > > PreRelease to some one enormous value, but not so large that
> > > TargetOnsetTime + Duration - PreRelease ever becomes negative!).
>
> > > -- David McFarlane, Professional Faultfinder
> > > ... six of one and half dozen of the other, you pays your money and
> > > takes your choice.
>
> > > >I've got an fMRI paradigm that is almost finished. I've embedded a
> > > >customized version of the likert script, and could use a little help
> > > >with a simple tweak. I'm a moderately skilled e-basic coder, so if you
> > > >can suggest a general strategy, I can probably implement it. As it is
> > > >coded now, the likert scale waits for a response before closing. The
> > > >actual slideobject it draws to has 0 duration, and as far as I can
> > > >tell, the script simply stops the the slide once a response is given.
> > > >I'd like to ensure that there is a time limit for the response, so
> > > >that the total possible time to respond is 6 seconds. I.e.  if a
> > > >participant answers in 2 seconds, there would be 4 seconds of fixation
> > > >following the answer, before moving on. I much appreciate any tips you
> > > >can lend.
>
> > > >Here is the inline that controls the Likert scale:
>
> > > >'Declare a variable for accessing each SlideText object and changing
> > > >properties.
> > > >Dim theSlideText As SlideText
>
> > > >Dim strName As String
> > > >Dim nLastResponseCount As Integer
> > > >nLastResponseCount = 0
>
> > > >Dim nNextMoveTime As Long
>
> > > >Dim strLastResponse As String
>
> > > >Dim boolMove As Boolean
> > > >boolMove = False
>
> > > >Dim theKeyboardResponseData As KeyboardResponseData
>
> > > >Do While Stimulus.InputMasks.IsPending()
>
> > > >         'Was there a response?
> > > >         If Stimulus.InputMasks.Responses.Count > nLastResponseCount Then
>
> > > >                 nLastResponseCount = nLastResponseCount +1
>
> > > >                 Set theKeyboardResponseData =
> > > >CKeyboardResponseData(Stimulus.InputMasks.Responses(nLastResponseCount))
>
> > > >                 If theKeyboardResponseData.RESP = "2" Then
>
> > > >                         'Subject has already selected the highest rating.
> > > >                         If intCurrent < 7 Then
>
> > > >                                 'Increment the current selection.
> > > >                                 intPrevious = intCurrent
> > > >                                 intCurrent = intCurrent + 1
>
> > > >                                 'Change border color of previously
> > > > selected box back to white,
> > > >change border
> > > >                                 'color of currently selected box to red.
> > > >                                 strName = "Text" & intPrevious
> > > >                                 Set theSlideText =
> > > >CSlideText(Stimulus.States.Item("Default").Objects(strName))
> > > >                                 theSlideText.BorderColor =
> > CColor("white")
>
> > > >                                 strName = "Text" & intCurrent
> > > >                                 Set theSlideText =
> > > >CSlideText(Stimulus.States.Item("Default").Objects(strName))
> > > >                                 theSlideText.BorderColor = CColor("red")
>
> > > >                                 boolMove = False
>
> > > >                         '       nNextMoveTime = Clock.Read + 500
> > > >                                 strLastResponse = "2"
>
> > > >                         End If
>
> > > >                 ElseIf theKeyboardResponseData.RESP = "1" Then
>
> > > >                         'Subject has already selected the lowest rating.
> > > >                         If intCurrent > 1 Then
>
> > > >                                 'Decrement the current selection.
> > > >                                 intPrevious = intCurrent
> > > >                                 intCurrent = intCurrent - 1
>
> > > >                                 'Change border color of previously
> > > > selected box back to white,
> > > >change border
> > > >                                 'color of currently selected box to red.
> > > >                                 strName = "Text" & intPrevious
> > > >                                 Set theSlideText =
> > > >CSlideText(Stimulus.States.Item("Default").Objects(strName))
> > > >                                 theSlideText.BorderColor =
> > CColor("white")
>
> > > >                                 strName = "Text" & intCurrent
> > > >                                 Set theSlideText =
> > > >CSlideText(Stimulus.States.Item("Default").Objects(strName))
> > > >                                 theSlideText.BorderColor = CColor("red")
>
> > > >                                 boolMove = False
>
> > > >                                 nNextMoveTime = Clock.Read + 500
> > > >                                 strLastResponse = "1"
>
> > > >                         End If
>
> > > >                 ElseIf theKeyboardResponseData.RESP = "{-2}" Or
> > > >theKeyboardResponseData.RESP = "{-1}" Then
>
> > > >                         If Mid(theKeyboardResponseData.RESP, 3, 1)
> > > > = strLastResponse Then
>
> > > >                                 boolMove = False
>
> > > >                         End If
>
> > > >                 End If
>
> > > >         ElseIf boolMove = True And (Clock.Read > nNextMoveTime) Then
>
> ...
>
> read more »

-- 
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.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list