alexa/skill-sample-nodejs-buttons-trivia

Name: skill-sample-nodejs-buttons-trivia

Owner: Alexa

Description: This is a sample skill using a set of built in trivia questions that will allow developers to get a head start on their trivia game skill using buttons. It allows for roll-call of the players, asking trivia questions and determining whether the voice inputs matched the answers.

Created: 2018-03-30 22:50:17.0

Updated: 2018-05-20 20:03:12.0

Pushed: 2018-05-20 20:03:11.0

Homepage: null

Size: 53

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Echo Buttons Trivia Game Template

Important: The Gadgets Skill API is in beta and is subject to change at any time without notice. We welcome your feedback.

This template offers a starting point for you to build your own Trivia Game skill featuring Echo Buttons. The template implements roll call and a game loop that handles asking and answering trivia questions. It handles receiving Echo Button events as well as animating the Echo Buttons lights.

Note You may use this template as a starting point to build your own trivia game skill. You can customize the questions list and some game parameters without making any code changes although in order to provide a unique game experience, you may have to make some code changes.

This sample skill uses:

Pre-requisites
Installation
  1. Clone the repository.

    t clone https://github.com/alexa/skill-sample-nodejs-buttons-trivia/
    
  2. Initialize the ASK CLI by Navigating into the repository and running the command: ask init and create a new profile called trivia-skill. Follow the prompts to configure the profile and associate it with one of your AWS profiles

     skill-sample-nodejs-buttons-trivia
    k init
    
  3. Install npm dependencies by navigating into the /lambda/custom directory and running the npm command: npm install

     lambda/custom
    m install
    
Deployment

ASK CLI will create the skill and the lambda function for you. The Lambda function will be created in the region associated with the AWS profile that you selected.

  1. Deploy the skill and the lambda function in one step by running the following command:

    k deploy -p trivia-skill
    
    Add DynamoDB permissions to the Lambda role

The ASK CLI automatically created a role for your lambda function to run under that can execute lambda functions and write to cloudwatch logs, but since we are using the built-in persistence of the Alexa Skills Kit for NodeJS SDK, we need to add a policy that will allow the role to create/read/write to DynamoDB

  1. Sign in to the AWS Management Console
  2. Navigate to the IAM Service console which is located under Compute services.
  3. Click Roles on the left side bar and find the role created for you by the ASK CLI. The name should start with ask-lambda-*
  4. On the Permissions tab, click the Attach Policy button
  5. In the search box, search for AmazonDynamoDBFullAccess, select the policy by clicking the checkbox to the left, and click the Attach Policy button at the bottom of the page.
Testing
  1. To test, you need to login to Alexa Developer Console, and enable the “Test” switch on your skill from the “Test” Tab.

  2. Simulate verbal interaction with your skill through the command line using the following example:

    sk simulate -l en-US -p trivia-skill -t "alexa, open buttons trivia"
    
    imulation created for simulation id: 4a7a9ed8-94b2-40c0-b3bd-fb63d9887fa7
    iting for simulation response{
    tatus": "SUCCESSFUL",
    .
    
  3. Once the “Test” switch is enabled, your skill can be tested on devices associated with the developer account as well. Speak to Alexa from any enabled device, from your browser at echosim.io, or through your Amazon Mobile App and say :

    a, open buttons trivia
    
Customization
  1. ge the skill name, example phrase, icons, testing instructions etc ...
    
    mber that many information is locale-specific and must be changed for each locale (en-GB and en-US)
    
    the Skill [Manifest Documentation](https://developer.amazon.com/docs/smapi/skill-manifest.html) for more information.
    
  2. fy messages, and facts from the source code to customize the skill.
    
  3. ge the model definition to replace the invocation name and the sample phrase for each intent.  Repeat the operation for each locale you are planning to support.
    
Additional Resources
Community
Tutorials & Guides
Documentation
License

This library is licensed under the Amazon Software License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.