Tips needed for tweaking the standard likert scale script

Micah ucfmicah at gmail.com
Thu Jul 21 16:42:29 UTC 2011


Thank you Todd! 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
>
> >                 If strLastResponse = "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")
>
> >                         End If
>
> >                 Else
>
> >                         '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")
>
> >                         End If
>
> >                 End If
>
> >                 nNextMoveTime = Clock.Read + 500
>
> >         End If
>
> >         Stimulus.Draw
>
> >Loop
>
> >'Change the BackColor property of the selected box to red to show the
> >subject
> >'that the response has been collected.
> >strName = "Text" & intCurrent
> >Set theSlideText =
> >CSlideText(Stimulus.States.Item("Default").Objects(strName))
> >theSlideText.BackColor = CColor("red")
>
> >'Redraw the Slide to show changes.
> >Stimulus.Draw
>
> >'Log rating in the data file under the attribute "Rating"
> >c.SetAttrib "Rating", intCurrent
>
> >Sleep 1000
>
> >'Return box to default appearance.
> >theSlideText.BackColor = CColor("green")
> >theSlideText.BorderColor = CColor("white")
>
> >strName = "Text4"
> >Set theSlideText =
> >CSlideText(Stimulus.States.Item("Default").Objects(strName))
> >theSlideText.BorderColor = CColor("red")
>
> >Stimulus.Draw
>
> >Set theSlideText = Nothing

-- 
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