[LON-CAPA-cvs] cvs: loncom /homework/templates Plot_data.problem
www
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 29 Oct 2007 16:21:12 -0000
www Mon Oct 29 12:21:12 2007 EDT
Modified files:
/loncom/homework/templates Plot_data.problem
Log:
People did not understand the other template since in fact it was not a problem.
Index: loncom/homework/templates/Plot_data.problem
diff -u loncom/homework/templates/Plot_data.problem:1.3 loncom/homework/templates/Plot_data.problem:1.4
--- loncom/homework/templates/Plot_data.problem:1.3 Mon Jul 30 17:52:21 2007
+++ loncom/homework/templates/Plot_data.problem Mon Oct 29 12:21:07 2007
@@ -1,35 +1,32 @@
<problem>
<script type="loncapa/perl">
-# Enter computations here
-### $amplitude = &random(1,4,0.5);
-### $x_min = -5;
-### $x_max = 5;
-### for ($x=$x_min;$x<=$x_max;$x=$x+0.05) {
-### push(@X,$x);
-### push(@Y,$amplitude*sin($x));
-### }
+$amplitude = &random(1,4,0.5);
+$x_min = -5;
+$x_max = 5;
+for ($x=$x_min;$x<=$x_max;$x=$x+0.05) {
+ push(@X,$x);
+ push(@Y,$amplitude*sin($x));
+}
</script>
<gnuplot width="300" transparent="off" samples="100" grid="on" font="9" bgcolor="xffffff" height="300" align="left" fgcolor="x000000" border="on" plottype="Cartesian" >
- <axis xmin="0" ymin="0" xmax="10" ymax="10" color="x000000" />
+ <axis xmin="$x_min" ymin="-5" xmax="$x_max" ymax="5" color="x000000" />
<xlabel>Label X</xlabel>
<ylabel>Label Y</ylabel>
<curve linestyle="linespoints" name="My Plot" pointtype="0" color="x000000">
- <data>1,2,3,4,5,6,7,8,9</data>
- <data>1,2,3,4,5,6,7,8,9</data>
+ <data>@X</data>
+ <data>@Y</data>
</curve>
</gnuplot>
-<startouttext />Enter Question Text Here.<endouttext />
+<startouttext />What is the amplitude of this function?<endouttext />
-<numericalresponse answer="">
+<numericalresponse answer="$amplitude" format="2s">
<responseparam name="tol" type="tolerance" description="Numerical Tolerance" default="5%" />
- <responseparam name="sig" type="int_range,0-16" description="Significant Figures" default="0,15" />
- <textline />
-<hintgroup>
-<startouttext /><endouttext />
-</hintgroup>
+
+ <textline readonly="no" />
+
</numericalresponse>
</problem>