Forum Discussion
Multiple Text Entry Quiz
Indrani,
I use Javascript to search some answers for a unique word or string of characters that users typically always get right. In all your misspellings, is there a unique string that invariably is there and would indicate they have the right idea?
In my question, the user typically enters a sentence. Since there is no way to predict exactly what they would type, I simply search for the word "plug". If the word is in the answer anywhere, I change their answer to the correct answer so the question is then marked as as correct.
var player = GetPlayer();
var str = player.GetVar("TextEntry2");
var n = str.search("plug");
if(n >= 0){
player.SetVar("TextEntry2", "TO PREVENT PLUGGING OF THE UNDERDRAIN");
}
In your situation, you can adapt this code to search for any short string that might always be there, something you can rely on all the misspellings.
This could be adapted to search for 2 or more different possible strings, as well.
This code would go onto a trigger that is executed when the TextEntry box loses focus.
- IndraniSen-e0834 years agoCommunity Member
Thank you for your input. I will certainly try to find a short string. No matter how we do it, it entails lot of work.
Best
Indrani