Created
October 21, 2017 19:29
-
-
Save barrieroberts/c35506b2bc16e53ebd477b73496f6ec6 to your computer and use it in GitHub Desktop.
14b Assignments (Move to individual sheets)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function assignments() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
//Get assignment | |
var fr = ss.getSheetByName("Assignment1"); | |
var lastRowValues = fr.getRange(fr.getLastRow(), 1, 1, fr.getLastColumn()).getValues(); | |
//Get the sheet of the student who's just submitted and append their assignment on that sheet | |
var sheets = ss.getSheets(); | |
for (var sh = 0 ; sh < sheets.length ; sh++) { | |
var sheetName = sheets[sh].getSheetName(); | |
if(lastRowValues[0][1] === sheetName){ | |
ss.getSheetByName(sheetName).appendRow(lastRowValues[0]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment