Drew
Published © CC BY-NC

Fact of the Day: Teen Dating Violence

This Teen Dating Violence Info app is a quick and easy way to get a Fact of the Day about teen dating violence.

BeginnerProtip2 hours587
Fact of the Day: Teen Dating Violence

Things used in this project

Hardware components

Amazon Echo
Amazon Alexa Amazon Echo
×1

Software apps and online services

Alexa Skills Kit
Amazon Alexa Alexa Skills Kit

Story

Read more

Schematics

Teen Dating Violence Info 1.0

VRU flow for Teen Dating Violence Info 1.0 including future functions

Code

index.js

JavaScript
Uploaded to Lambda
/**
    Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.

    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

        http://aws.amazon.com/apache2.0/

    or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

/**
 *
 * TDV Info eventually will include: fact of the day; 10 warning signs; safety plan.
 * Fact of the Day is the first version.
 *
 * This simple sample has no external dependencies or session management, and shows the most basic
 * example of how to create a Lambda function for handling Alexa Skill requests.
 *
 * Examples:
 * One-shot model:
 *  User: "Alexa, ask Teen Dating Violence info for a fact"
 *  Alexa: "Here's your teen dating violence fact: ..."
 */

/**
 * App ID for the skill
 */
var APP_ID = "amzn1.echo-sdk-ams.app.169fc77a-d545-4faf-a78f-647bd2c78d41"; //replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]";

/**
 * Array containing space facts.
 */
var TDV_FACTS = [
        "One third of all teens in an abusive relationship never tell anybody about it.",
        "81% of parents either believe that teen dating violence is not an issue or just don't know.",
        "58% of parents cannot identify all the warning signs of an abusive relationship.",
        "84% of pregnant teen girls are in abusive relationships.",
        "If a teen girl is in an abusive relationship, she is twice as likely to get an S T I.",
        "By the time that they graduate from college, 44% of all students have been in an abusive relationship.",
        "One point five million high school students experience Physical abuse every year in the U.S.",
        "One in ten high school students are physically hit or hurt by their dating partner.",
        "Students in abusive dating relationships are more likely to engage in serious drug or alcohol abuse.",
        "Students in abusive dating relationships are more likely to drop out of school.",
        "Students in abusive dating relationships are more likely to engage in self-harm and suicidal ideation.",
        "Less than 25% of teens have discussed dating violence with their parents.",
		"One in three Seventh grade students in the U.S. report being a victim of dating violence.",
		"One in five college students in the U.S. are currently in an abusive relationship.",
        "Warning sign of an abusive relationship number one: when your partner constantly puts you down.",
		"Warning sign of an abusive relationship number two: when your partner tells you what to wear.",
		"Warning sign of an abusive relationship number three: when your partner threatens to hurt you or themselves.",
		"Warning sign of an abusive relationship number four: when your dating partner blames you for their anger.",
	    "Warning sign of an abusive relationship number five: when your dating partner does not respect your wishes about safe sex.",
        "Warning sign of an abusive relationship number six: when your dating partner threatens to reveal private information or images.",
		"Digital abuse example number one: demanding your partner's social media password.",
        "Digital abuse example number two: incessant and unwanted texts demanding to know where you are or what you are doing.",
        "Digital abuse example number three: logging into your email or social media account and pretending to be you.",
        "Warning sign of an abusive relationship number seven: history of discipline problems.",
        "Warning sign of an abusive relationship number eight: serious drug or alcohol abuse.",
        "Warning sign of an abusive relationship number nine: prevents you from spending time with friends or family.",
        "Nearly 80% of girls who have been physically abused continue to date the abuser.",
        "57% of college students say that it is difficult to identify dating abuse.",
        "58% of college students say that they do not know how to help somebody in an abusive relationship.",
        "Physical abuse, sexual abuse, and emotional abuse are all forms of dating violence.",
        "Teen dating violence is also sometimes called dating abuse.",
        "Teen dating violence is also sometimes called relationship abuse.",
        "Teen dating violence is also sometimes called intimate partner violence.",
        "L G B T couples are equally as likely to be in an abusive relationship as other couples.",
        "Less than 20% of high school counselors feel prepared to address dating violence on campus.",
        "If you know someone who might be in an abusive relationship, ask them how you can help.",
        "If you know someone who might be in an abusive relationship, encourage them to seek help.",
		"If you know someone who might be in an abusive relationship, educate yourself about dating violence and healthy relationships so that you might be able to help.",
        "50% of people age 14 to 24 have experienced digital abuse.",
        "The financial impact of domestic violence in the U.S. every year is eight point three billion dollars.",
        "The most common location for teen dating abuse is at home.",
        "Only 5% of teens in an abusive relationship have called an abuse helpline.",
        "Only 15% of teens in an abusive relationship have talked to a school counselor.",
        "89% of teens between the age of 13 and 18 say that they've been in a dating relationship."
];

/**
 * The AlexaSkill prototype and helper functions
 */
var AlexaSkill = require('./AlexaSkill');

/**
 * This is a child of AlexaSkill.
 * To read more about inheritance in JavaScript, see the link below.
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript#Inheritance
 */
var SpaceGeek = function () {
    AlexaSkill.call(this, APP_ID);
};

// Extend AlexaSkill
SpaceGeek.prototype = Object.create(AlexaSkill.prototype);
SpaceGeek.prototype.constructor = SpaceGeek;

SpaceGeek.prototype.eventHandlers.onSessionStarted = function (sessionStartedRequest, session) {
    console.log("SpaceGeek onSessionStarted requestId: " + sessionStartedRequest.requestId
        + ", sessionId: " + session.sessionId);
    // any initialization logic goes here
};

SpaceGeek.prototype.eventHandlers.onLaunch = function (launchRequest, session, response) {
    console.log("SpaceGeek onLaunch requestId: " + launchRequest.requestId + ", sessionId: " + session.sessionId);
    handleNewFactRequest(response);
};

/**
 * Overridden to show that a subclass can override this function to teardown session state.
 */
SpaceGeek.prototype.eventHandlers.onSessionEnded = function (sessionEndedRequest, session) {
    console.log("SpaceGeek onSessionEnded requestId: " + sessionEndedRequest.requestId
        + ", sessionId: " + session.sessionId);
    // any cleanup logic goes here
};

SpaceGeek.prototype.intentHandlers = {
    "GetNewFactIntent": function (intent, session, response) {
        handleNewFactRequest(response);
    },

    "AMAZON.HelpIntent": function (intent, session, response) {
        response.ask("You can ask Teen Dating Violence Info tell me a fact, or, you can say exit... What can I help you with?", "What can I help you with?");
    },

    "AMAZON.StopIntent": function (intent, session, response) {
        var speechOutput = "Goodbye";
        response.tell(speechOutput);
    },

    "AMAZON.CancelIntent": function (intent, session, response) {
        var speechOutput = "Goodbye";
        response.tell(speechOutput);
    }
};

/**
 * Gets a random new fact from the list and returns to the user.
 */
function handleNewFactRequest(response) {
    // Get a random fact from the TDV facts list
    var factIndex = Math.floor(Math.random() * TDV_FACTS.length);
    var fact = TDV_FACTS[factIndex];

    // Create speech output
    var speechOutput = "Today's teen dating violence fact is: " + fact;

    response.tellWithCard(speechOutput, "TDVinfo", speechOutput);
}

// Create the handler that responds to the Alexa Request.
exports.handler = function (event, context) {
    // Create an instance of this skill.
    var spaceGeek = new SpaceGeek();
    spaceGeek.execute(event, context);
};

Credits

Drew

Drew

2 projects • 1 follower
Founder and Executive Director of Jennifer Ann's Group, a nonprofit organization using technology in innovative ways to prevent teen dating violence.

Comments