STACK: interchangable indices

STACK: interchangable indices

by Elias Eingang -
Number of replies: 3
Hello,

I was wondering if STACK has some possibility to allow an answer to be correct regardless of the sub index used. So for example, if the teacher answer is x_i, let x, x_a, x_0,... also be a correct answer (but not y_i).

I tried to facilitate that with the SubstEquiv answer test, but then not only the index i is interchangable, but the whole atom x_i (so again y_i would count as correct when it shouldn't be). Trying the additional option to fix i yielded no success, as that also seems to apply to i as an atom, not as an index.

Best regards!
Average of ratings: -
In reply to Elias Eingang

Re: STACK: interchangable indices

by Christopher Sangwin -
Picture of Plugin developers
Gosh, nobody has asked for that.  It would be relatively easy to test this (I think), especially at a superficial string-match level.  If you want to do something like

a:x

ans1:a_3

then test if the start of ans1 is really "x", then that's much harder!  Please could you raise an issue on github, with a rationale, and some examples?  
https://github.com/maths/moodle-qtype_stack/issues
We can discuss the details of the feature request there.

Chris

In reply to Elias Eingang

Re: STACK: interchangable indices

by Andreas Steiger -
Picture of Plugin developers
I think you could use SubstEquiv to establish that the formula is correct, and then use a second PRT node where you check the variable names using listofvars(ans) and something like is(charat(string(var),1)="x") for each variable.


Attachment Bild_2024-04-04_103024990.png