Skip to content

Instantly share code, notes, and snippets.

@bmelnychuk
Last active August 16, 2018 08:09
Show Gist options
  • Save bmelnychuk/18e2e49b38f636a74cf275ae69f93417 to your computer and use it in GitHub Desktop.
Save bmelnychuk/18e2e49b38f636a74cf275ae69f93417 to your computer and use it in GitHub Desktop.
class TextEqualityAnswerValidationPolicy implements AnswerValidationPolicy {
isAnswerValid(userAnswer: string, correctAnswer: string): Promise<boolean> {
return Promise.resolve(
userAnswer.trim().toLowerCase() === correctAnswer.toLowerCase()
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment