SHARE
TWEET

Untitled

a guest Mar 25th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Round start intent
  2. startNewRound(() => {
  3.     const ssmlResponse = new Ssml();
  4.     ssmlResponse.audio(getRandomAudio(AUDIO_TYPES.AUDIO_GAME_INTRO), 'game intro');
  5.     ssmlResponse.say(sprintf(getRandomPrompt(PROMPT_TYPES.GREETING_PROMPTS_2), GAME_TITLE));
  6.     ssmlResponse.say(getRandomPrompt(PROMPT_TYPES.INTRODUCTION_PROMPTS));
  7.     ssmlResponse.say(getRandomPrompt(PROMPT_TYPES.FIRST_ROUND_PROMPTS));
  8.     askQuestion(ssmlResponse, questionPrompt, selectedAnswers);
  9.   }
  10. });
  11.  
  12. //Ask question
  13. const askQuestion = (ssmlResponse, question, answers) => {
  14.   logger.error(logObject('trivia', 'askQuestion', {
  15.     info: 'askQuestion: No questions',
  16.     question: question,
  17.     answers: answers
  18. });
  19.  
  20. //Check that answer is correct
  21. const isValidAnswer = (answer, answers) => {
  22.   return (answer && !isNaN(parseInt(answer)) &&
  23.   parseInt(answer) < (answers.length + 1) && parseInt(answer) > 0);
  24. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top