From 0367237c0fc72584fb2ba0923ca01f6cad7394fc Mon Sep 17 00:00:00 2001 From: Ian Turgeon Date: Wed, 10 Jun 2020 20:01:12 -0400 Subject: [PATCH 1/2] removes white and blacklist terminology --- .../src/process-attrs.js | 4 ++-- .../server/express_response_decorator.js | 2 +- .../assessment-rubric.js | 22 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/app/obojobo-document-json-parser/src/process-attrs.js b/packages/app/obojobo-document-json-parser/src/process-attrs.js index 51b2c203c2..f1a591b76d 100644 --- a/packages/app/obojobo-document-json-parser/src/process-attrs.js +++ b/packages/app/obojobo-document-json-parser/src/process-attrs.js @@ -1,12 +1,12 @@ const xmlEncode = require('./xml-encode') -const processAttrs = (content, blackListedAttributes) => { +const processAttrs = (content, blockedAttributes) => { let attrs = '' for (const attr in content) { if ( content[attr] === null || typeof content[attr] === 'object' || - blackListedAttributes.includes(attr) + blockedAttributes.includes(attr) ) { continue } diff --git a/packages/app/obojobo-express/server/express_response_decorator.js b/packages/app/obojobo-express/server/express_response_decorator.js index 94c063da96..83b972fa4e 100644 --- a/packages/app/obojobo-express/server/express_response_decorator.js +++ b/packages/app/obojobo-express/server/express_response_decorator.js @@ -5,7 +5,7 @@ const apiUrlRegex = /\/api\/.*/ const oboEvents = oboRequire('server/obo_events') const getSanitizedErrorMessage = e => { - // If the error is in our blacklist only return the error name: + // If the error is in our blockList only return the error name: if (e instanceof QueryResultError) { return e.constructor.name } diff --git a/packages/obonode/obojobo-sections-assessment/assessment-rubric.js b/packages/obonode/obojobo-sections-assessment/assessment-rubric.js index a2b698b528..9186427b3a 100644 --- a/packages/obonode/obojobo-sections-assessment/assessment-rubric.js +++ b/packages/obonode/obojobo-sections-assessment/assessment-rubric.js @@ -35,14 +35,14 @@ const MOD_AMOUNT_LIMIT = 20 const getRubricType = rubric => !rubric || !rubric.type ? AssessmentRubric.TYPE_ATTEMPT : rubric.type -const createWhitelistedRubric = rubric => { +const createStandizedRubric = rubric => { const rubricType = getRubricType(rubric) - let whitelistedRubric + let standardizedRubric switch (rubricType) { case AssessmentRubric.TYPE_PASS_FAIL: - whitelistedRubric = Object.assign( + standardizedRubric = Object.assign( { passingAttemptScore: 100, passedResult: 100, @@ -55,7 +55,7 @@ const createWhitelistedRubric = rubric => { case AssessmentRubric.TYPE_ATTEMPT: default: - whitelistedRubric = { + standardizedRubric = { passingAttemptScore: 0, passedResult: AssessmentRubric.VAR_ATTEMPT_SCORE, failedResult: 0, @@ -64,10 +64,10 @@ const createWhitelistedRubric = rubric => { break } - return whitelistedRubric + return standardizedRubric } -const createWhitelistedMod = mod => { +const createStandardizedMod = mod => { // Ensure at least one condition exists: if (!mod.attemptCondition) { return null @@ -87,10 +87,10 @@ const createWhitelistedMod = mod => { } } -const modToObject = whitelistedMod => { +const modToObject = standarizedMod => { return { - attemptCondition: getRangeString(whitelistedMod.attemptCondition), - reward: whitelistedMod.reward + attemptCondition: getRangeString(standarizedMod.attemptCondition), + reward: standarizedMod.reward } } @@ -111,9 +111,9 @@ class AssessmentRubric { const mods = rubric && rubric.mods ? rubric.mods.slice(0, MOD_AMOUNT_LIMIT) : [] - this.rubric = createWhitelistedRubric(rubric) + this.rubric = createStandizedRubric(rubric) this.type = getRubricType(rubric) - this.mods = mods.map(createWhitelistedMod).filter(mod => mod !== null) + this.mods = mods.map(createStandardizedMod).filter(mod => mod !== null) } toObject() { From 0173845ffde130df3da5d27d819c1eced907f06f Mon Sep 17 00:00:00 2001 From: Ian Turgeon Date: Thu, 11 Jun 2020 09:50:39 -0400 Subject: [PATCH 2/2] Fix misspelled variable Co-authored-by: Zachary Berry --- .../obojobo-sections-assessment/assessment-rubric.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/obonode/obojobo-sections-assessment/assessment-rubric.js b/packages/obonode/obojobo-sections-assessment/assessment-rubric.js index 9186427b3a..329b1b4f6d 100644 --- a/packages/obonode/obojobo-sections-assessment/assessment-rubric.js +++ b/packages/obonode/obojobo-sections-assessment/assessment-rubric.js @@ -35,7 +35,7 @@ const MOD_AMOUNT_LIMIT = 20 const getRubricType = rubric => !rubric || !rubric.type ? AssessmentRubric.TYPE_ATTEMPT : rubric.type -const createStandizedRubric = rubric => { +const createStandardizedRubric = rubric => { const rubricType = getRubricType(rubric) let standardizedRubric @@ -87,10 +87,10 @@ const createStandardizedMod = mod => { } } -const modToObject = standarizedMod => { +const modToObject = standardizedMod => { return { - attemptCondition: getRangeString(standarizedMod.attemptCondition), - reward: standarizedMod.reward + attemptCondition: getRangeString(standardizedMod.attemptCondition), + reward: standardizedMod.reward } } @@ -111,7 +111,7 @@ class AssessmentRubric { const mods = rubric && rubric.mods ? rubric.mods.slice(0, MOD_AMOUNT_LIMIT) : [] - this.rubric = createStandizedRubric(rubric) + this.rubric = createStandardizedRubric(rubric) this.type = getRubricType(rubric) this.mods = mods.map(createStandardizedMod).filter(mod => mod !== null) }