Counting words in openended


Author
Message
Oliver
Oliver
Partner Member (632 reputation)Partner Member (632 reputation)Partner Member (632 reputation)Partner Member (632 reputation)Partner Member (632 reputation)Partner Member (632 reputation)Partner Member (632 reputation)Partner Member (632 reputation)Partner Member (632 reputation)
Group: Forum Members
Posts: 3, Visits: 1

Is there a way to count words in openended while subjects are writing and using the count as a condition for ending the trial? More concretely, I want to modify the Picture Story Exercise module posted on the Inquisit website so that participants have to write a minimum of 100 words for each openenden iteam before they can move on to the next trail.


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: 12K, Visits: 98K

You'll want to use /isvalidresponse along with a bunch of (recursive*) <expressions>. Not easy to do, but should be possible. (I'd recommend counting the number of spaces.) Using the number of characters as criterion would be considerably easier (/range attribute or use the length() function).


Regards,


~Dave


*cf. the Self-Paced Reading script available from the Task Library.


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: 12K, Visits: 98K

And just for fun here's a little word-counting algorithm that doesn't require any recursion:


<values>
/ mysentence = "The quick brown fox jumps over the lazy dog."
</values>

<expressions>
/ nwords = length(values.mysentence)-length(replaceall(values.mysentence," ",""))+1
</expressions>

<text mytext>
/ items = ("The sentence ~"<%values.mysentence%>~" contains <%expressions.nwords%> words.")
</text>


Regards,


~Dave


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search