Skip to content

Commit 3346fee

Browse files
committed
When finding undefined variables, consider all variables defined in the base scope as bound.
Eukleides defines a lot of variables that should really be constants (it was written before constants existed).
1 parent f6459a4 commit 3346fee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

editor/static/js/question/edit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ $(document).ready(function() {
12391239
scope.setVariable(v.name(), v.value());
12401240
});
12411241

1242-
var exam_variable_names = this.exam_variables.map(v => v.name());
1242+
var scope_variable_names = Object.keys(scope.allVariables());
12431243

12441244
//make structure of variables to evaluate
12451245
var todo = {};
@@ -1268,7 +1268,7 @@ $(document).ready(function() {
12681268
if(!tree) {
12691269
throw(new Numbas.Error('jme.variables.empty definition',{name:name}));
12701270
}
1271-
var vars = jme.findvars(tree,exam_variable_names,scope);
1271+
var vars = jme.findvars(tree, scope_variable_names, scope);
12721272
v.error('');
12731273
}
12741274
catch(e) {

0 commit comments

Comments
 (0)