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

Fixing isAnswerSlotValid in Flash cards #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrischang
Copy link

…all the time and fixing typo and descriptions

…all the time and fixing typo and descriptions
@chrischang chrischang changed the title making sure isAnswerSlotValid actually return something instead of 1 … Fixing isAnswerSlotValid in Flash cards Aug 8, 2016
var answerSlotFilled = intent.slots && intent.slots.Answer && intent.slots.Answer.value;
var answerSlotIsInt = answerSlotFilled && !isNaN(parseInt(intent.slots.Answer.value));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just fixed this myself using

function isAnswerSlotValid(intent) {
    var answerSlotFilled = intent.slots && intent.slots.Answer && intent.slots.Answer.value;
    var answerSlotIsInt = answerSlotFilled && !isNaN(parseInt(intent.slots.Answer.value));
    return answerSlotIsInt
}

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