--- loncom/homework/templates/Rnumerical.problem 2009/06/23 03:01:20 1.2 +++ loncom/homework/templates/Rnumerical.problem 2009/07/06 17:12:47 1.3 @@ -1,4 +1,5 @@ <problem> + <script type="loncapa/perl"> $seed=&random(1,500,1); $n=&random(15,25,1); @@ -19,12 +20,12 @@ $answer=&cas_hashref_entry($answerdata,' <startouttext /> Consider the plotted data set.<br /> <endouttext /> + <gnuplot width="400" solid="0" plotcolor="monochrome" gridlayer="off" bmargin="default" font="9" alttag="dynamically generated plot" bgcolor="xffffff" texfont="22" transparent="off" plottype="Cartesian" rmargin="default" gridtype="Cartesian" minor_ticscale="0.5" fontface="sans-serif" grid="on" align="left" texwidth="93" height="300" border="on" samples="100" fgcolor="x000000" major_ticscale="1" tmargin="default" lmargin="default" fillstyle="empty"> <curve linestyle="points" linetype="solid" color="x000000" pointtype="3" limit="closed" pointsize="2" linewidth="1"> <data>@x</data> <data>@y</data> </curve> - </gnuplot> <startouttext /> @@ -32,9 +33,10 @@ Consider the plotted data set.<br /> Give a linear function approximating the data.<br /> <tt>y(x)=</tt> <endouttext /> + <formularesponse id="11" answer="$answer" samples="x@1:$n#20"> <responseparam name="tol" default="2%" description="Numerical Tolerance" type="tolerance" /> <textline size="25" readonly="no" /> - </formularesponse> + </problem>