<problem> <script type="loncapa/python"> # from loncapa import * x1 = 4 # lc_random(2,4,1) y1 = 5 # lc_random(3,7,1) x2 = 10 # lc_random(x1+1,9,1) y2 = 20 # lc_random(y1+1,15,1) m = (y2-y1)/(x2-x1) b = y1 - m*x1 answer = "%s*x+%s" % (m,b) answer = answer.replace('+-','-') inverted_m = (x2-x1)/(y2-y1) inverted_b = b wrongans = "%s*x+%s" % (inverted_m,inverted_b) wrongans = wrongans.replace('+-','-') </script> <text> <p>Hints can be provided to students, based on the last response given, as well as the history of responses given. Here is an example of a hint produced by a Formula Response problem.</p> <p> What is the equation of the line which passess through ($x1,$y1) and ($x2,$y2)?</p> <p>The correct answer is <tt>$answer</tt>. A common error is to invert the equation for the slope. Enter <tt> $wrongans</tt> to see a hint.</p> </text> <formularesponse samples="x@-5:5#11" id="11" answer="$answer"> <responseparam description="Numerical Tolerance" type="tolerance" default="0.001" name="tol" /> <text>y = <formulaequationinput size="25" /></text> <hintgroup> <formulahint samples="x@-5:5#11" answer="$wrongans" name="inversegrad"> </formulahint> <hintpart on="inversegrad"> <text>You have inverted the slope in the question.</text> </hintpart> </hintgroup> </formularesponse> </problem>