numbas / editor

An editor for the Numbas e-learning system.
http://numbas.mathcentre.ac.uk
Apache License 2.0
59 stars 61 forks source link

Show an error warning when a name occurs more than once in the names list of a destructured variable #813

Open christianp opened 5 months ago

christianp commented 5 months ago

For example, put a,b,a in the name field, and [1,2,3] in the definition field. When you run the question, an error "There is more than one definition of the variable a." is shown. The editor should show a warning, too. At the moment, it shows both values in the generated value box.

When there's only one variable name in the list, e.g. a,a, the editor does display an error "There's another variable or constant with the name a."

IsaacJrTypes commented 3 months ago

Hi @christianp, I will be working on this.

MarkBuster commented 3 months ago

I will also be working on this as part of CodeDay.

christianp commented 2 months ago

It turns out that the editor does show an error if there's only one unique name in the list, so I've edited the issue description.