Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants