From f2ce2102a2bbbdaa0c47584c551f68e6214d0f58 Mon Sep 17 00:00:00 2001 From: Cameron Matheson Date: Tue, 21 Aug 2012 17:46:53 -0600 Subject: [PATCH] allow variables to have the value 0 fixes #8155 Test plan: * create a formula quiz question * make the variable definition x with a min/max of 0 * make a formula definition that uses x (ex: 5 + x). You should see a computed value, not an error message Change-Id: Ida604c4b0c10b2567ab6061e8205c823366c9aea Reviewed-on: https://gerrit.instructure.com/13127 Tested-by: Jenkins Reviewed-by: Zach Pendleton --- public/javascripts/calcCmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/calcCmd.js b/public/javascripts/calcCmd.js index cf049f637fb..6b4b17b7e1d 100644 --- a/public/javascripts/calcCmd.js +++ b/public/javascripts/calcCmd.js @@ -266,7 +266,7 @@ define([ } var value = predefinedVariables && predefinedVariables[tree.value]; value = value || (variables && variables[tree.value]); - if(!value) { + if (value == undefined) { throw("undefined variable " + tree.value); } return value;