Hi all,
I wonder if anyone can help me. I'm new to the STACK question type. A lot of the documentation jumps in at a fairly advanced level of algebra. However, I'm attempting to set up an introductory algebra quiz.
I'm starting with a simple question: "simplify by gathering like terms".
Currently, my question variables are:
aa:5-rand(10);
bb:5-rand(10);
cc:5-rand(10);
dd:5-rand(10);
ee:5-rand(10);
ff:5-rand(10);
v:rand([a,b,c]);
w:rand([a,b,c]);
x:rand([a,b,c,d]);
simp: false;
z:ev(aa*w,simp)+ev(bb*x,simp)+ev(cc*w,simp)+ev(dd*v,simp)+ev(ee*x,simp)+ev(ff*v,simp);
This, produces the required question, z, in my previews. The question text is:
Simplify the following expression: @z@
input:ans1
validation:ans1
However, because this is basic algebra, I'm focusing a lot on the format. I need to know that their answer is not only algebraically equivalent, but written in its simplest form. I don't want them to simply type in the question and get it correct.
The first node in my answer tree checks for algebraic equivalence and seems to be working as anticipated. However, once it is evaluated as algebraically equivalent, I need to ensure it is in simplest form. I don't seem to be able to get this to work. The check for "LowestTerms" always seems to indicate that it is, even if it is clearly not the case.
I've also tried to use the "nterms" function to count the terms, but it also seems to simplify the terms.
Any pointers on how to achieve this would be appreciated.