Inappropriate Text Input
1217 0 2Hi All,
Answers ( 2 )
I assume you're saving what they type for the username as a variable to display back to them later?
It probably isn't possible to put conditions on what they type to prevent the saving of unwanted text, there'd be so many possible words. Plus add in the creativity of youth and the list would be endless.
How important is the uniqueness of the username? You could allow them to type in anything, but then set the variable to be something else, i.e., don't tie the type in box to the variable, just set the variable automatically when the page loads. The feedback instructions could explain that "for this simulation we'll just use a standardized username".
Or maybe they need to type in a specific username (based on your instructions), and you could use conditions to confirm that's what they typed.
Comments
( 1 )
Yes, the username will be used to reference the user throughout the course and the uniqueness is very important.
I could use conditions to prevent the obvious though I suppose.
While there isn't anything built in you could use our ContentAPI to get the variable value for the text input and then in your HTML widget sanitize the text (e.g., https://www.folkstalk.com/2022/09/sanitizing-user-input-javascript-with-code-examples.html)
Comments
( 0 )