MCPcopy Create free account
hub / github.com/codecombat/codecombat / color

Function color

app/views/editor/verifier/i18nVerifierView.js:142–151  ·  view source on GitHub ↗
(problem)

Source from the content-addressed store, hash-verified

140 return ((1 - ((problem.trimmed != null ? problem.trimmed.length : undefined) / problem[this.messageOrHint].length)) * 100).toFixed(0)
141 },
142 color (problem) {
143 const amountTranslated = this.percentDifference(problem)
144 if (amountTranslated >= this.completeThreshold) {
145 return 'green'
146 } else if (amountTranslated >= this.partialThreshold) {
147 return 'yellow'
148 } else {
149 return 'red'
150 }
151 },
152 getProblemsAndCompare (levelSlug) {
153 return this.getProblems(levelSlug).then(problems => {
154 return this.compareStrings(problems)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected