Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name End of Module Return to Home
// @namespace _| /\ |< {
// @version 0.1
// @description Send user to home page when reaching end of module page instead of going to the next module
// @author Jake Standish jacob.standish@cms.k12.nc.us
// @match https://*.instructure.com/*/pages/*
// @grant none
// ==/UserScript==
/****************************************************************************
*****************************************************************************
*************** CUSTOM NAVIGATION TAB ****************
*************** Referenced from goo.gl/z4WBCD ****************
*************** Use with your own discretion. ***************
****************************************************************************/
/* TEACHER & ADMIN CUSTOM NAV */
/* replace "URL" with the url of the image you want to apper for the custom icon. Recommend a published Google Drawing */
var img_url = '<img src="URL" w="70%" align="center"/>'
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CANVAS API Call Template
// by Jake Standish [jacob.standish@cms.k12.nc.us]
// Written December, 2016
// You are free to copy and moodify this code at your own risk.
//
// INSTRUCTIONS
// 1. Copy this code.
// 2. Open a google apps script file from a Google Spreadsheet, Form, Document, or Google Apps Script (script.google.com).
// 3. Obtain your access token from Canvas and paste it's value in the parenthese after var accessToken =
function deleteExtraColsAndRows() {
var ss = SpreadsheetApp.getActiveSheet()
//Columns
var lastCol = ss.getLastColumn();
var endc = ss.getMaxColumns();
try{
ss.deleteColumns(lastCol+1, endc-lastCol);
}catch(e){Logger.log('col error: '+e)}
//////////////////////////////////////////////////////////////////////////
// Install within a Google Form and have the "On Form Submit" trigger set
// canvasAPI function is seperate and can be found by searching the Canvas Community for james@richland.edu
//////////////////////////////////////////////////////////////////////////
function onFormSubmit(e) {
var email = e.response.getRespondentEmail();
var random = Math.floor(Math.random() * 9999);
var ssID = ""; //put destination spreadsheetID here
var ss = SpreadsheetApp.openById(ssID);
///////////////////////////////////////////////////////
// Google Form Email Script
// Author: Jacob Standish (jacob.standish@cms.k12.nc.us)
// This script sends an email to a person or group every time the form is submitted
// The body of the message contains the responses from the form styled with the form questions as HEADING2 and responses as Paragraphs.
// This script needs to be installed into a Google Form (not the spreadsheet) with the On Form Submit trigger set
///////////////////////////////////////////////////////
var recipients = "recipient@yourdomain.com"; //replace with the address you want to receive the email
////////////////////////////////////////////////////////////////////////
//The function takes two inputs:
//url = Spreadhsheet URL
//sheetName = name of sheet in Spreadsheet you want to convert to json
//The resulting json objects will be a named based on text in the cells of row 1 with spaces removed
////////////////////////////////////////////////////////////////////////
function getSpreadsheetData(ssURL,sheetName){
var ss = SpreadsheetApp.openByUrl(ssURL);
var sheet = ss.getSheetByName(sheetName);
var data = sheet.getDataRange().getValues();