Tips needed for tweaking the standard likert scale script
Micah
ucfmicah at gmail.com
Thu Jul 21 14:45:28 UTC 2011
Hallo,
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