maths / moodle-qtype_stack

Stack question type for Moodle
GNU General Public License v3.0
138 stars 147 forks source link

Calling Inert Functions Inside MCQ Answer Options #1117

Closed fowal44p closed 3 months ago

fowal44p commented 4 months ago

I'm trying to write a MCQ where the options to choose from are real sets. When I use the inert union function %union to join two real sets, it seems to read that I'm calling the union rather than the %union function, as I get the error "union: argument must be a set; found: oo(4,inf)" A MWE of my code is: ta_MCQ:[[A,true,%union(oo(-inf,f1nr1),oo(f1nr1,inf))]];

If it's something to do with not being able to call the inert function within a list, I've tried defining the interval outside the list and then referencing that variable in the MCQ options list. E.g. d:%union(oo(-inf,f1nr1),oo(f1nr1,inf)); ta_MCQ:[[A,true,d]];

but I get the same error. Any help understanding what's going on here will be greatfully received.

sangwinc commented 3 months ago

This is really to do with evaluation/re-evaluation of expressions. The teacher's answer gets translated from %union to union, to show something a student could type in. This is then later evaluated which creates the error. I'm having trouble tracking down a fix, which is annoying.

sangwinc commented 3 months ago

Sorry about this bug. I hope this is now fixed.