STACK: wrong input interpretation

STACK: wrong input interpretation

by Benedikt Köhler -
Number of replies: 6

Hi everyone,

on our server STACK (version 4.2.1) seems to interpret the text input wrongly.

It is a logarythm quiz.

the correct answer is :

lg(x)/n 


loga correct


you may also type:

"1/n * lg(x)" which is mathmatically the same but interpreted wrong by Moodle.

loga incorrect


Can you help me letting Moodle also accept the second way to type it ?


Best,


Benedikt


Average of ratings: -
In reply to Benedikt Köhler

Re: STACK: wrong input interpretation

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 answer tests are you using in the potential response tree for this question?
In reply to Tim Hunt

Re: STACK: wrong input interpretation

by Benedikt Köhler -
jepp... I switched from "EqualComAss" to "AlgEquiv" .
Now the interpretation is correct. I think, I tried that before but without success...
...hope there are no side-effects.

sorry for asking and many thanks!


Best,

Bendedikt
In reply to Benedikt Köhler

Re: STACK: wrong input interpretation

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That sounds like the correct test for what you want.

The best way to get confident that your question is grading things the way you hope is to add some question tests (https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/Authoring/Testing.md#writing-tests)
In reply to Tim Hunt

Re: STACK: wrong input interpretation

by Christopher Sangwin -
Picture of Plugin developers
Thanks Tim,

Yes, I think you want algebraic equivalence here not EqualsComAss.  There are too many mathematical moves which are beyond equivalence up to the commutative and associative properties of +, * etc.

Tim mentioned test cases.  I've added this example to the test cases as we have nothing similar.  The code is here:
https://github.com/maths/moodle-qtype_stack/commit/e94f4135f2ace573a7b2821f0526e714d83f22f1

It is useful to add this test case in case someone in the future decides that \( \log(x^n) \neq n\log(x) \) (Well, we are making all sorts of tacit assumptions about x & n here which might not hold, e.g. if they are complex numbers).  Anyway, putting in a test case will at least flag up a behaviour we want now and alert us something someone asked for has changed.

They are also useful to illustrate what the test will actually do.  

If you have problems like this in the future you can add tests of your own, and see the results via this script.
http://[...]/?moodle?/question/type/stack/answertests.php
(You may have to be a site admin...)

Please send us your test cases, via a pull request if possible or email if not.

I very much welcome examples and discussion.  There is often some interesting and subtle point we need to consider.
Chris
In reply to Benedikt Köhler

Re: STACK: wrong input interpretation

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

I do not think "AlgEquiv" alone will work on this question because it does not prevent entering the left hand side again. You would have to add extra nodes to the response tree and still use each "EqualComAss" case separately.

In reply to Daniel Thies

Re: STACK: wrong input interpretation

by Stephan Bach -
Maybe it would be the easiest to use "EqualComAss" to compare "ev(ans1,simp)" instead of just "ans1" with the teachers answer. Maybe this does still not cover every case, but entering the left side again would be graded as wrong in this case and \(\frac{1}{n} \lg x\) or also \(n^{-1} \lg x\) would be graded as correct.
Stephan