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
203 stars 117 forks source link

Problem deploying an exam which has variables defined by destructuring #784

Closed ugoertz closed 3 years ago

ugoertz commented 3 years ago

When deploying this exam on a Moodle page, students opening it get the message that Numbas failed because of a TypeError: tok is undefined.

This seems to be caused by the definition of variables by destructuring (and hence is easy to avoid). (In fact, I am not really sure whether this definition by destructuring is even "allowed" at this point ...)

The problem occurs regardless of whether the exam is deployed as an "external tool" pointing to the Numbas LTI provider, or uploaded as a SCORM package. The "Test Run" for the exam works, though.

christianp commented 3 years ago

Destructuring is supposed to work now, and this error was a silly oversight: I didn't account for spaces between the variable names. Thanks for reporting this.