STACK: SubstEquiv not working as expected?

STACK: SubstEquiv not working as expected?

د Elias Eingang لخوا -
د ځوابونو شمیر: 2
Hello,

I've run into a problem with the SubstEquiv answer test and I am not sure if the test is not working as intended or if I am misunderstanding how it is supposed to work.

Consider a simple example where the correct answer is

A*sin(x) + B*cos(x)

I want the names of the coefficients A and B to be able to be chosen freely, whereas the argument x must be written as x. So, in the prt I choose SubstEquiv as the answer test and set the test option as [x]. If one now gives the answer

C*sin(x) + D*cos(x)

or

B*sin(x) + A*cos(x)

these are deemed correct with the expected substitutions [C = A, D = B] and [B = A, A = B], respectively. So far so good.

However, if one gives the answer

A*sin(z) + B*cos(z)

it is still counted as the correct answer with the substitution [z = x]. But shouldn't exactly this be counted wrong as per the test options, fixing x as x? Is there a way to enforce that the argument of sin and cos must be written as x?

Help would be much appreciated.
د درجې بندۍ اوسط:  -
In reply to Elias Eingang

Re: STACK: SubstEquiv not working as expected?

د Christopher Sangwin لخوا -
د Particularly helpful Moodlers انځور د Plugin developers انځور
Elias,
Yes, you are right.  We fixed this problem recently and you can see the test case here
https://github.com/maths/moodle-qtype_stack/blob/dev/tests/fixtures/answertestfixtures.class.php#L677
(the student uses "t", not "z" as in your example).

The commit is here
https://github.com/maths/moodle-qtype_stack/commit/56b1119251c94ecd80f928f6b81dbd21c8a09d19

It will be in the next release.
Chris