░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/ui/features/quizzes
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: quiz_formula_solution.js
/* * Copyright (C) 2014 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ import numberHelper from '@canvas/i18n/numberHelper' export default class QuizFormulaSolution { constructor(result) { this.result = result } rawValue() { return numberHelper.parse(this.rawText()) } rawText() { if (this.result === null || this.result === undefined) { return 'NaN' } return this.result.substring(1).trim() } isValid() { return !!(this._wellFormedString() && this._appropriateSolutionValue()) } _wellFormedString() { const result = this.result return !!(result.match(/^=/) && result !== '= NaN' && result !== '= Infinity') } _appropriateSolutionValue() { const rawVal = this.rawValue() return !!(rawVal == 0 || rawVal) } }
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📁 backbone/
DIR
—
2023-09-24 03:36
📁 jquery/
DIR
—
2023-09-24 03:39
📁 jst/
DIR
—
2023-09-24 03:36
📄 index.js
JS
1.6 KB
2023-09-24 03:36
EDIT
📄 package.json
JSON
81 B
2023-09-24 03:36
EDIT
📄 quiz_formula_solution.js
JS
1.4 KB
2023-09-24 03:36
EDIT