In a text entry interaction, I want one of the acceptable answers to be a space. I've entered a space, but when the slide plays the space isn't recognized as correct.
Is a space an acceptable answer, and if so, how is that indicated?
Looks as if the evaluation for the question doesn't recognize a single space. There is a way to evaluate for a space but you'd need to use a custom interaction and some JavaScript to get it done.
(space) isn't picked up by condition evaluation. However, a space sandwich is: ~(space)~
So by adding a variable - I added one called converted - you can send the field variable out to have "bread" added and pushed back in for evaluation. Here's a bit of JavaScript that would do that:
var player=GetPlayer(); var entry=player.GetVar("TextEntry"); player.SetVar("converted","~"+entry+"~");
On your processing button, execute the javascript trigger then, using your translated variable, evaluate for your sandwich (~ ~, ~your answer~).
5 Replies
Hi Michael. You could use the shortcut key freeform quiz type instead to detect that the spacebar has been pressed.
Thanks for the reply, Stephanie.
I'm not familiar with that and don't see it as a choice among the options in the Quizzing slides.
Can you give some more details?
Hi Michael,
Here's the tutorial on working with the shortcut key question type, but that is not the same as using a text entry interaction.
If using a fill in the blank or something similar, I don't believe a space will be recognized as a text entry answer.
Looks as if the evaluation for the question doesn't recognize a single space. There is a way to evaluate for a space but you'd need to use a custom interaction and some JavaScript to get it done.
(space) isn't picked up by condition evaluation. However, a space sandwich is: ~(space)~
So by adding a variable - I added one called converted - you can send the field variable out to have "bread" added and pushed back in for evaluation. Here's a bit of JavaScript that would do that:
var player=GetPlayer();
var entry=player.GetVar("TextEntry");
player.SetVar("converted","~"+entry+"~");
On your processing button, execute the javascript trigger then, using your translated variable, evaluate for your sandwich (~ ~, ~your answer~).
See attachment for an example.
Appreciate all the suggestions. Thanks!
This discussion is closed. You can start a new discussion or contact Articulate Support.