fixing typos in "survey-text" responses #2024
-
My experiment uses type: "survey-text". Is there a way to fix typo's in participants' responses? correct responses are being labelled as incorrect because of a space at the end or because of one missed letter. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @rbruno1, you can easily get rid of the whitespace at the start and end of a string with the JavaScript trim function. Detecting a missing letter is probably going to be trickier. You could look at using regular expressions. One fairly simple thing you could do with regular expressions is remove any non-alphabetic characters from the response (assuming that the response should just be letters), which will catch typos containing numbers, punctuation etc. |
Beta Was this translation helpful? Give feedback.
Hi @rbruno1, you can easily get rid of the whitespace at the start and end of a string with the JavaScript trim function. Detecting a missing letter is probably going to be trickier. You could look at using regular expressions. One fairly simple thing you could do with regular expressions is remove any non-alphabetic characters from the response (assuming that the response should just be letters), which will catch typos containing numbers, punctuation etc.