Forum Discussion
Prevent enter key from submitting text entry for evaluation
Hi,
I am having a problem with the text entry. I would like the learner to be able to type a longer text into the text entry box. When he presses 'enter', a line break should be created within the text entry box. However, as soon as the learner presses the enter key, the text is automatically submitted and the learner is moved on to the next slide. Is there a way around this? I deleted the 'next' and 'submit' button and created my own submit button, but this didn't work either. Can anybody help? Thank you.
Sabine
- ChristinaClark-Community Member
I'm running into a slightly different version of this problem. We present learners with a sentence that has no punctuation and ask them to type the whole sentence into the text entry field with correct punctuation. Some sentences are long enough to need two lines, so we make the text boxes tall enough for that. They are allowed 2 attempts. There is a custom submit button on the slide with a trigger to submit the interaction when user clicks submit button.
If learner enters text and presses submit, all is well.
However, if learner enters text and hits ENTER out of habit, that submits the interaction.
The problem is that the ENTER also registers as a linebreak so even if they enter the correct answer, the extra line break makes the answer register as incorrect. When they go back for their second attempt, the linebreak is still there and very easy to miss, so the learner can easily still get the incorrect feedback layer just because they have a linebreak at the end of their answer.
So we need Storyline to either interpret ENTER = submit or ENTER = text entry, but not both at the same time.
Hello Christina!
It sounds like you're looking for the option to choose whether the Enter key will allow a user to submit a question or add a line break. I'm happy to share this approach with my team.
Currently, when there's a data-entry field on a question slide, pressing the Enter key on the keyboard submits your response for evaluation. Using Shift+Enter will add line breaks. On a content slide, Enter or Shift+Enter adds a line break (return), so you can start a new paragraph.
I did find a workaround that to be honest, is a bit clunky but it does the trick. Here's a quick demo!