Thanks Nancy and David, cannot take too much credit for the code, I originally wrote a function and realised it didn't take account of double spaces, found a version of this code online and modified it, much cleaner than my original solution.
You could use it to count the number of words in an essay question, perhaps the user has a minimum or maximum word count.
I could use it to validate a text entry field perhaps a single word answer such as "rewrwrew" (I type something like this in most text entry field in courses) is not a valid answer so may make the user write an answer or maybe not.
Sometimes I just build what I am asked to build :-)
Katie, I used something like this in a writing exercise in which the learner was supposed to edit a paragraph to make it concise. If they got it down to 50 words I gave them the option to skip the lesson.
7 Replies
Very cool, Phil. This will be another great example to add to our conference demos folder. Thanks for sharing the file.
I wrote some JavaScript for this as well but yours looks a lot cleaner - thanks Phil.
Thanks Nancy and David, cannot take too much credit for the code, I originally wrote a function and realised it didn't take account of double spaces, found a version of this code online and modified it, much cleaner than my original solution.
So...what would one use this for Phil? Could you provide me a little background on why a developer would use this code?
You could use it to count the number of words in an essay question, perhaps the user has a minimum or maximum word count.
I could use it to validate a text entry field perhaps a single word answer such as "rewrwrew" (I type something like this in most text entry field in courses) is not a valid answer so may make the user write an answer or maybe not.
Sometimes I just build what I am asked to build :-)
Thanks Phil!
Katie, I used something like this in a writing exercise in which the learner was supposed to edit a paragraph to make it concise. If they got it down to 50 words I gave them the option to skip the lesson.
This discussion is closed. You can start a new discussion or contact Articulate Support.