Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. function takeWordAnswer(agent) {
  2. let context = agent.context.get('takeword-followup');
  3. let hanzi = context.parameters.hanzi;
  4. var correct = hanzi.translation.split("|");
  5. if (correct.includes(agent.parameters.answer.toLowerCase()))
  6. agent.add('answer is correct!');
  7. else
  8. agent.add('oh no! The correct answer was '+correct.join());
  9. agent.add(new Suggestion(`More`));
  10. agent.add(new Suggestion(`Bye!`));
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement