-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscratchpad.gs
83 lines (72 loc) · 2.45 KB
/
scratchpad.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
function extractTabName() {
var rbssId = "1E9SOqXdsqWlmyWrl08pkg4GiZ78fksdjeABxbzz1vxM";
var rbss = SpreadsheetApp.openById(rbssId);
var srcName = "Y2021 Christian Perspectives TB Jun2019 Reportbook"; // rbss.getName();
// TODO FIXME subYear and tabName should come from Reportbooks tab
var len = srcName.length;
var subYear = srcName.substring(0,5);
Logger.log(subYear);
var tabName = rbss.getSheetByName(top.SHEETS.OVERVIEW)
.getRange(top.RANGES.OVERVIEWSUBJECT).getValue();
Logger.log(tabName);
}
function falsey() {
// falsy values
if (false) Logger.log("True!");
if (null) Logger.log("True!");
if (undefined) Logger.log("True!");
if (0) Logger.log("True!");
if (NaN) Logger.log("True!");
if ('') Logger.log("True!");
if ("") Logger.log("True!");
if ([]) Logger.log("Empty array => true!");
if ({}) Logger.log("Empty object => true!");
student = {}
Logger.log(! student.email);
}
function checkBackup(tabName) {
return tabName.indexOf("_backup") == -1;
}
function filterList() {
var tabs = ["fish_backup", "loaf", "cow_backup", "pig"];
Logger.log(tabs.filter(checkBackup));
}
// Old scale: SCI Y07 Reportbook - done
// Old scale: MAT Y06 Reportbook - done
// Old scale: ENG A 2018 Y07 Reportbook - done
// Old scale: DRA Y06 Reportbook - done
// Old scale: DRA Y07 Reportbook - done
// Old scale: DRA Y08 Reportbook - done
// Old scale: DRA Y09 Reportbook - done
// Old scale: MAT SL Y12 Reportbook
// Old scale: PED Y06 Reportbook - done
// Old scale: PED Y08 Reportbook
// Old scale: PED Y09 Reportbook
// Old scale: PED Y10 Reportbook
// Old scale: ENG IB A 2018-20 Y11 Reportbook
// Old scale: ENG IB A 2019-20 Y12 Reportbook
// Old scale: MUS Y06 Reportbook
// Old scale: MUS Y07 Reportbook
// Old scale: CPE Y10 Reportbook
//function dataValidationTest() {
// var aaa = "1CGQAR4QafGnC_LarUQqECY2Fy9Dv8jBkIsNlwUyuS3Y";
// // Set the data-validation rule for cell A3 to require a value from B1:B10.
// var ss = SpreadsheetApp.openById(aaa);
// var sheet = ss.getSheetByName("Grades");
// var cell = sheet.getRange('A3');
// var valuesRange = sheet.getRange('D7:D33');
// var namesValidation = SpreadsheetApp
// .newDataValidation()
// .requireValueInRange(valuesRange)
// .build();
//
// var checkboxValidation = SpreadsheetApp
// .newDataValidation()
// .requireCheckbox("Y", "N")
// .build();
//
// cell.setDataValidation(namesValidation);
// sheet.getRange("AB7:AB").setDataValidation(checkboxValidation);
//}
//
//