Capitalize Function


Author
Message
jfanderson
jfanderson
Partner Member (753 reputation)Partner Member (753 reputation)Partner Member (753 reputation)Partner Member (753 reputation)Partner Member (753 reputation)Partner Member (753 reputation)Partner Member (753 reputation)Partner Member (753 reputation)Partner Member (753 reputation)
Group: Forum Members
Posts: 5, Visits: 12
Just a note - it appears that the capitalize function only makes the first letter uppercase if it was previously lowercase. If a user enters text that is in all caps (e.g., "BOB"), the capitalize function, in my experience, retains the entire text as all uppercase. 
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
That is correct. If this undesirable in your paradigm, convert the response to all lowercase first, then capitalize:

<values>
/ a = ""
/ b = ""
</values>

<block myblock>
/ trials = [1=sequence(myopenended, mytrial)]
</block>

<openended myopenended>
/ ontrialend = [values.a=capitalize(openended.myopenended.response);
    values.b=capitalize(tolower(openended.myopenended.response)); ]
</openended>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%values.a%> | <%values.b%>")
</text>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search