Writing a question with changing inequalities symbol

7 views
Skip to first unread message

Andrew P Neate

unread,
Feb 18, 2026, 7:12:49 AM (2 days ago) Feb 18
to Numbas Users
Hi, I'm trying to write a set of questions at the moment on solving inequalities and I want students to have to decide which inequality symbol to use.

I've tried using expressions as answers but Numbas is incorrectly marking anything whose sign agrees as correct (e.g. if x>=5 was the correct answer then it also marks x>=1 as correct but not x>=-1).

The other thing I've tried is using gapfill and having a box for the symbol and a box for the number but I can't seem to find a way to get the drop-down list to display \geq and \leq signs correctly and I don't see any other option from the possible answer types.

Is there something I'm doing wrong here for either of these methods or is it just not possible to write the type of question I'm looking for? The only other thought I had would be to try trick the expression restriction to only marking exactly the correct answer right but it certainly wouldn't be elegant and I'm not sure it would work anyway. Any help at all would be appreciated.

Thanks,
Andrew

Laura Midgley

unread,
Feb 18, 2026, 10:52:36 PM (2 days ago) Feb 18
to Numbas Users
Hi Andrew,

Mathematical expression part types are by default marked in the range 0-1 (see the docs for more details), so both x>=1 and x>=5 are always 'false' (unless it happens to check precisely 1).

You can change what values are checked in the 'accuracy' tab of the question - setting the checking range around the number you are looking for (so start at 4 end 6 for example) should lead to the marking you're looking for.

If you're needing it to determine between > and >= that would be a little trickier, and would likely need inputting as a restriction to apply a penalty for the missing = (or to use a custom marking algorithm).

Hope this gets it to work!

- Laura

Ben Brawn

unread,
Feb 19, 2026, 1:42:59 AM (yesterday) Feb 19
to Numbas Users
I also had trouble with this. We opted for the drop-down menu approach and instead of using LaTeX which duplicates itself, we use the html symbols (i.e. you can copy-paste the symbols from websites like this https://www.piliapp.com/symbols/less-than-or-equal/)
Reply all
Reply to author
Forward
0 new messages