numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
199 stars 118 forks source link

Either show an error when there's an undefined variable, or silently ignore it #916

Closed christianp closed 2 years ago

christianp commented 2 years ago

Someone just had an exam derailed by a question which had an empty variable - the variable had no name or definition.

The exam looked OK in preview, but crashed when trying to save the SCORM suspend data because the treeToJME on undefined failed.

We should either ignore such variable definitions, or throw an error message when the exam loads. I prefer to ignore completely empty variables. Variables with a name but no definition should throw an error.

christianp commented 2 years ago

It looks like there's already code to catch completely empty variables, so something else is going on.