equivalence examination in STACK

equivalence examination in STACK

by Sarah Rudd -
Number of replies: 3

Hi,

In a STACK query (Moodle 4.5) I define a result as:

LSG1: sqrt(5)*a;

so that stands for a written:

sol1

Obviously that is euivalent for:

sol2

But if the students type in:

sqrt(5 * a^(2))

STACK sees that a wrong answer. Is there chance to let STACK check the equivalence of the result and come to the conclusion that the second student answer is also right? Or do I have to define a second answer, say:

LSG2: sqrt(5 * a^(2))

and check via the decision tree structure, if somebody typed in the the second way to write it ?

Thanks for your help!

Best,

Sarah

Average of ratings: -
In reply to Sarah Rudd

equivalence examination in STACK

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What if a = -1?

sqrt(5 * a^(2)) = sqrt(5)

sqrt(5) * a = -sqrt(5)
Average of ratings: Useful (1)
In reply to Tim Hunt

equivalence examination in STACK

by Christopher Sangwin -
Picture of Plugin developers

Thanks Tim, 

Exactly.  We decided that sqrt(a^2)=abs(a) and _not_ equal to a.  These test cases are here

https://github.com/maths/moodle-qtype_stack/blob/master/tests/fixtures/answertestfixtures.class.php#L128
https://github.com/maths/moodle-qtype_stack/blob/master/tests/fixtures/answertestfixtures.class.php#L132

If you put assume(a>0) in the question variables, then the PRT should accept both.

Chris