Peter,
This is a very interesting use of STACK which I didn't anticipate when I wrote the question type. I'm happy to help you get this working, and am sorry I didn't spot this thread earlier (I don't routinely follow the quiz forum).
I've updated the question.
I changed question level simplify to "false", this will stop STACK from automatically changing the student's answer from 1+1 to 2, for example. I also think absolute tolerance with numbers of 0.01 makes more sense here than a relative tolerance.
There are two properties you are looking for in the answer to the third part.
(1) it is equivalent to d/t using the numerical test for accuracy
(2) it entered as a single number - I've used Maxima's predicate function numberp(ex) to establish this.
Since these are separate properties, I've added a second node to the potential response tree to check each separately.
Note that numberp "Returns true if expr is a literal integer, rational number, floating point number, or bigfloat, otherwise false." So, numberp(5.0/3.1) is false, because this is the ratio of two floats. numberp(50/31) is true.....
If you really want a float here, you should use the predicate floatnump. But, this will not work if you have 5 (an integer) instead of 5.0 (an equivalent float). So, if you want to avoid this problem, you need to use "floatnump(ex) or integerp(ex)". This will be true if you have a float or integer, but not a rational.
I've also made the input to ans1 reject any answer containing "/" as invalid. This makes it impossible for students to enter a division (the most likely thing they will do) and won't generate any penalties for this in the scoring mechanism (if you choose to use this). There are docs on this feature, but for me this makes most sense in this case. Doing this, also means we don't have the problem with the rational 4/5 for the answer when you really wanted the student to *calculate* this to be 0.8 for example.....
Yes, there are lots of options, but there is a mind set to STACK and I hope you persevere and make some progress. I'm happy to help.
I've added a third node which checks if the student's answer is equivalent to the reciprocal of the correct answer. This is a common mistake, and one I'd like to add feedback to.
I've also added some "question tests" to the question. You can see these on the top right of the try page. This feature is for question quality control.
I agree STACK is resource hungry, and I've tried my best to address this issue. Optimize maxima and turn the cache on. Avoid timed exams with a hard end time which encourage large groups of students to simultaneously submit large quizzes. I shouldn't need to issue this warning, but that is the reality. Sorry!
Please let me know how you get on.
Chris