commit c2483b7b5bba6432f75f8b830e0948a7cf309a9e
parent d38911a9861c0c0e6fb821b8226489a08e6f9dd4
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date: Sat, 5 Sep 2020 11:53:41 -0700
Fix leaked global variables.
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Scripts/Quizzer.js b/Scripts/Quizzer.js
@@ -165,14 +165,14 @@ function Submit() {
}
// Parse answer
- answers = app.prompt[3].toLowerCase().split(","); // Split string by commas
+ let answers = app.prompt[3].toLowerCase().split(","); // Split string by commas
for (var i = 0; i < answers.length; i++) {
answers[i] = answers[i].trim(); // Trim whitespace
}
// Check responce
var correct = true;
- for(var answer of answers) {
+ for (var answer of answers) {
if (!responces.includes(answer)) {
correct = false;
}
diff --git a/Scripts/Settings.js b/Scripts/Settings.js
@@ -192,7 +192,7 @@ function ApplyVocabFilter(vocabSet, name) {
function ApplyVerbFilter(terms, filterInfo) {
// Create filters
let filters = []; // Format: [{outputIndex:0, inputIndex:0, filterIndex:0, filterValue:"regex"}]
- for (config of filterInfo) {
+ for (let config of filterInfo) {
// Get regularity
let regularity;
switch (config.type.toLowerCase()) {
@@ -279,9 +279,9 @@ function ApplyVerbFilter(terms, filterInfo) {
// Filter terms
let results = []; // Format: [[<output label>, <output>, <input label>, <input>]]
- for (filter of filters) {
+ for (let filter of filters) {
// Iterate over terms (minus headers)
- for (term of terms.slice(1)) {
+ for (let term of terms.slice(1)) {
// Check against filters
if (term[filter.filterIndex].match(filter.filterValue)) {
results.push([terms[0][filter.outputIndex], term[filter.outputIndex], terms[0][filter.inputIndex], term[filter.inputIndex]]);