Mike Bentley wrote:I'm not sure how feasible this is, but if you could hook into the Search API for something like Google or Bing you could potentially leverage their vast database of spell checking to be more lenient about misspelled answers.
Good idea.
Mike Bentley wrote:Also, what's the logic behind using String.Contains rather than String.Equals?
The answer strings are stored in the database as whatever the packet writer wrote them as. Therefore, they will contain more information than necessary (longer names, alternate answers, prompts, etc.). A String.equals would necessitate that whoever answered it said exactly what the packet writer wrote after "ANSWER:", which is nearly impossible. String.contains is a quick and dirty solution to this problem. It gives more leeway for the answers. However, it'll allow people to put in troll answers like "", and "a," but if they do know what the answer is, they'll get it right, which is what I was aiming for at first.
Now, I think we need a better approach. Perhaps a combination of some autocorrection via search APIs with a split, then String.equals.