Script for cleaning up participants' typed responses
Paul Groot
pfc.groot at gmail.com
Sun Apr 14 20:23:10 UTC 2013
hi,
You can get rid of explicit {SHIFT} responses in the response values by
setting an allowable mask that only includes the characters you actually
allow. For example, you might set it to the following to allow alphabetic
characters, the equal sign and the plus sign:
{ALPHA}{=}{+}{ENTER}
If you use the enter-key as input-terminator, you also have to include that
one explicitly.
So, that is the easy part. If you also would like to replace the special
{key} responses with the original literal (i.e. replace {+} with just +),
you also have to add some script after the input screen (TextDisplay1 in
this example):
Dim t As String
Dim pos As Integer
Dim ii As Integer
' Define a table with two columns: {key} and replacement
' The rows must include all literal {key}'s used in the input allowable mask
Const NSPECIAL%=3
Dim special (1 To NSPECIAL, 1 To 2) As String
special(1,1) = "{+}"
special(1,2) = "+"
special(2,1) = "{=}"
special(2,2) = "="
special(3,1) = "{ENTER}"
special(3,2) = ""
t = UCase(TextDisplay1.RESP) 'convert input to upper case
For ii=1 To NSPECIAL
Dim key As String
key = special(ii,1)
'find special {key} strings
pos = InStr(t,key)
If pos<>0 Then
' replace special {key}'s with their original character
t = Left(t,pos-1) & special(ii,2) & Mid(t,pos+Len(key))
ii = ii-1 ' tricky cheat: retry this same special sequence again
End If
Next
' show result in next text display object
TextDIsplay2.Text = TextDisplay1.RESP & ebCrLf & "is replaced by:" & ebCrLf
& t
'overwrite the RESP attribute (note: disable default loging first)
c.SetAttrib TextDisplay1.Name & ebDot & ebLogNameRESP, t
Also find this example code in the attached script (requires EP 2.0.10.242).
Best
Paul
On 12 April 2013 20:17, HFAC <bgbellows at gmail.com> wrote:
> Matt,
> I am also having a problem with E-Prime recording {SHIFT}. See my post for
> a more detailed explanation of my problem:
> https://groups.google.com/forum/?fromgroups=#!topic/e-prime/wysgwiaYR_0
>
> I would like to try the script that you mentioned but cannot seem to
> locate it. If possible, will you post a response to me and attach it? I
> would greatly appreciate it.
>
> On Wednesday, April 16, 2008 1:10:01 PM UTC-4, Matt wrote:
>>
>> Hi Joseph,
>>
>> I have added a sample experiment to the Files section of this group
>> (TextString.es). This sample echoes subject responses and then "cleans
>> up" the special characters that are used by parsing the string. You
>> can look through the comments in the script to see how this parsing is
>> done. The sample only handles a few cases (e.g., Shift, period, etc).
>> However, you can modify the script to handle many different cases.
>>
>> Please let me know if you have any questions after looking at the
>> sample.
>>
>> Sincerely,
>> Matt Lenhart
>> PST Technical Consultant
>> http://pstnet.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "E-Prime" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to e-prime+unsubscribe at googlegroups.com.
> To post to this group, send email to e-prime at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/e-prime/-/uvA3tqVcEa8J.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
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/20130414/c70605f0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resp_shift_check.es2
Type: application/octet-stream
Size: 48310 bytes
Desc: not available
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20130414/c70605f0/attachment.obj>
More information about the Eprime
mailing list