Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for case-insensitivity and give hints #41

Closed
martinheidegger opened this issue Dec 28, 2014 · 1 comment
Closed

Test for case-insensitivity and give hints #41

martinheidegger opened this issue Dec 28, 2014 · 1 comment

Comments

@martinheidegger
Copy link
Collaborator

I got reminded in nodeschool/discussions#700 that sometimes the problem occurs that people don't see the difference in their output. uppercase/lowercase etc. It might be good to check something like:

function normalise(string) {
   return string.replace(/\.|\!|\?|\s|/g, "").toLowerCase()
}

function isProbablyTypo(expectedAnswer, answer) {
   return normalise(expectedAnswer) === normalise(answer)
}

if (isProbablyTypo(expectedAnswer, answer)) {
   console.log("Looks like you did the right thing but maybe you had a typo in there. We are a little picky to make sure that you understood the question. Maybe you want to check for typos?")
}
@SomeoneWeird
Copy link
Member

Now that we have diff'ing in the latest javascripting, this shouldn't be much of an issue anymore. Going to close for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants