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
200 stars 118 forks source link

'nonzero' and 'nonone' annotations for the $n special pattern matcher #840

Closed christianp closed 2 years ago

christianp commented 3 years ago

These would be useful for insisting that a coefficient is worth including.

The annotations that change $n's behaviour are defined in runtime/scripts/jme-rules.js, in number_conditions. To implement this, add entries for nonzero and nonone which check that tok.value != 0 (or 1)

odavarci commented 2 years ago

Can I take this issue?

christianp commented 2 years ago

@odavarci thanks for offering to help! Please look at our guidance on contributing to Numbas. For this issue, you only need this repository, the Numbas runtime - the editor isn't necessary.

odavarci commented 2 years ago

@christianp, I pulled a request.