Skip to content

Instantly share code, notes, and snippets.

// SDK USAGE
// On doument load resolve the SDK dependecy
function Initialize(onComplete) {
require(["Speech.Browser.Sdk"], function(SDK) {
onComplete(SDK);
});
}
// Setup the recongizer
function RecognizerSetup(SDK, recognitionMode, language, format, subscriptionKey) {
//what is the URL of your google spreadsheet?
var sheetURL = 'YOUR_URL_HERE';
var scoreVarName = 'userScore'; //what is the name of the score varible in Lectora?
var userVarName = 'userName'; //what is the name of the user name varible in Lectora?
var topTenVarName = 'topTenMsg'; //what is the name of the top ten message varible in Lectora?
/**** Do not edit below this line unless you are confident about your JS skills. ****/
var userScore = eval("Var"+scoreVarName).getValue(); //Get the score from the player
var userTag = eval("Var"+userVarName).getValue(); //Get the user name from the player
//what is the URL of your google spreadsheet?
var sheetURL = 'YOUR_URL_HERE';
var scoreVarName = 'userScore'; //what is the name of the score varible in Captivate?
var userVarName = 'userName'; //what is the name of the user name varible in Captivate?
var topTenVarName = 'topTenMsg'; //what is the name of the top ten message varible in Captivate?
/*
*** Do not edit below this line unless you are confident about your JS skills. ***
*/
// Usage
// 1. Save your GAS Project
//
// 2. Click: Run > setup
//
// 3. Click: Publish > Deploy as web app
// - enter Project Version Description (optional)
// - set security level and enable service ( execute as 'me' and access 'anyone, even anonymously)
//
// 4. Copy the 'Current web app URL' and paste it into the Leaderboard JavaScript file (first line)
//what is the URL of your google spreadsheet?
var sheetURL = "YOUR_URL_HERE";
var scoreVarName = "userScore"; //what is the name of the score varible in SL?
var userVarName = 'userName'; //what is the name of the user name varible in SL?
var topTenVarName = 'topTen'; //what is the name of the top ten message varible in SL?
/*
*** Do not edit below this line. ***
*/
var player = GetPlayer(); //Get the SL player