<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>A thought (probably not a good one) -- couldn't you do a check of the response string with perl to count the number of occurrences of the variable?  Count that each variable appears no more than once before sending it to maxima?</div><div><br></div><div><br></div><div><br>Sent from my mobile phone, so please forgive any spehling errers. </div><div><br>On 2012-11-05, at 23:12, "Seema Ali" <<a href="mailto:sali@vsb.bc.ca">sali@vsb.bc.ca</a>> wrote:<br><br></div><blockquote type="cite"><div>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">



<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I'd like to create dynamic polynomial questions that require students to simplify them. I was wondering how to do I check to see if the students actually entered a simplified version
 of the expression, but keep it still free enough to allow the order of terms to be different.
<div><br>
</div>
<div>For example:</div>
<div>1. 3a + 2b - 4a + 6b</div>
<div>Students could enter: -a + 8*b, or 8*b - a, or -1*a + 8*b, or 8*b + -a, etc for it to be correct.</div>
<div>I'm concerned that a student could also enter equivalent unsimplified responses like: </div>
<div>3*a + 2*b - 4*a + 6*b or -a + 2b + 6b and still have it marked correctly.</div>
<div><br>
</div>
<div>I'd like to create a variety of short answer polynomial questions, but I'm not sure how much work it will be.</div>
<div><br>
</div>
<div>The code below contains an example with a,b,c variables. It creates polynomials and it marks it correct if the answer entered is equivalent to the question, not necessarily the simplified form.</div>
<div><br>
</div>
<div>Any insight on this will be appreciated.</div>
<div><br>
</div>
<div>
<div><problem></div>
<div><script type="loncapa/perl">$coeff_a1 = &random(-1,1,2)*&random(2,10,1);</div>
<div>$coeff_a2 = &random(-1,1,2)*&random(2,10,1);</div>
<div>$coeff_b1 = &random(-1,1,2)*&random(2,10,1);</div>
<div>$coeff_b2 = &random(-1,1,2)*&random(2,10,1);</div>
<div>$coeff_c1 = &random(-1,1,2)*&random(2,10,1);</div>
<div>$coeff_c2 = &random(-1,1,2)*&random(2,10,1);</div>
<div><br>
</div>
<div>$answer = &cas('maxima', "$coeff_a1*a + $coeff_b1*b + $coeff_c1*c + $coeff_a2*a + $coeff_b2*b + $coeff_c2*c");</div>
<div><br>
</div>
<div>$answershow = &xmlparse($answer);</script><startouttext />Simplify.</div>
<div><m eval='on'></div>
<div>\[\Large</div>
<div>   $coeff_a1 a + $coeff_b1 b + $coeff_c1 c + $coeff_a2 a + $coeff_b2 b + $coeff_c2 c</div>
<div>\]</div>
<div></m></div>
<div><br>
</div>
<div>$answershow</div>
<div><br /></div>
<div>Answer:<endouttext /></div>
<div><mathresponse cas="maxima" answerdisplay="$answer" args="$answer"></div>
<div>    <answer>f(x) := RESPONSE[1];</div>
<div>g(x) := LONCAPALIST[1];</div>
<div>is(trigsimp(f(x)-g(x))=0);</answer></div>
<div>    <textline readonly="no" /></div>
<div>    <hintgroup showoncorrect="no"></div>
<div>        <startouttext /></div>
<div><br>
</div>
<div>        <endouttext /></div>
<div>    </hintgroup></div>
<div></mathresponse></div>
<div></problem></div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks.</div>
</div>


</div></blockquote><blockquote type="cite"><div><ATT00001..c></div></blockquote></body></html>