forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix negative variable evaluation on formula questions
fixes CNVS-9970 If you use a negative variable as the first element in a formula expression, formula question operation breaks. For example, when you put: -[x]+5 in the body of the formula question, and then attempt to put: -x+5 in the formula definition, the formula question JavaScript does not know how to parse the expression. This commit adds graceful logic for these cases. Test plan - Create a formula question with the initial variable cast as negative - Formula definitions should be calculated correctly. Regression - Confirm that formula questions still work correctly with positive variables Change-Id: I8d2c6f596bb0211e375c5a347dfa8a1ea2870271 Reviewed-on: https://gerrit.instructure.com/33003 Tested-by: Jenkins <[email protected]> Reviewed-by: Stanley Stuart <[email protected]> Reviewed-by: Jason Madsen <[email protected]> QA-Review: Caleb Guanzon <[email protected]> Product-Review: Josh Simpson <[email protected]>
- Loading branch information
Showing
1 changed file
with
23 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters