File:  [LON-CAPA] / loncom / homework / templates / Plot_data.problem
Revision 1.5: download - view: text, annotated - select for diffs
Mon Jul 6 17:12:47 2009 UTC (14 years, 10 months ago) by bisitz
Branches: MAIN
CVS tags: version_2_9_99_0, bz6209-base, bz6209, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3
Consistent problem templates:
- New line after each tag (not for texts in foils)
- One empty row after each end tag and before new start tag for second level tags
- No indentation for second level tags, e.g. <script>
- Four white spaces as indentation for each further sub level
    Exceptions:
        -Content (mostly text) in separate line(s): no indentation
        - Concept groups: same indentation as foilgroup
          (allows to insert code from problems without concept groups without changing the indentation and vice versa)
- No new line at end of template
- Removed new lines from within the middle of default texts
- Added one blank each after "<m>$" and before "$</m>" to ensure no misinterpretation neither by human nor by machine (e.g. "<m>$x" is not "<m>$ $x")
- Replaced deprecated font tag in <instructorcomment> by CSS
- Removed dos line endings
- dos2unix conversion
  (ClickImageExample.problem, RandomLabelExample.problem, SimpleMatching.problem)

    1: <problem>
    2: 
    3: <script type="loncapa/perl">
    4: $amplitude = &random(1,4,0.5);
    5: $x_min = -5;
    6: $x_max =  5;
    7: for ($x=$x_min;$x<=$x_max;$x=$x+0.05) {
    8:    push(@X,$x);
    9:    push(@Y,$amplitude*sin($x));
   10: }
   11: </script>
   12: 
   13: <gnuplot width="300" transparent="off" samples="100" grid="on" font="9" bgcolor="xffffff" height="300" align="left" fgcolor="x000000" border="on" plottype="Cartesian" >
   14:     <axis xmin="$x_min" ymin="-5" xmax="$x_max" ymax="5" color="x000000" />
   15:     <xlabel>Label X</xlabel>
   16:     <ylabel>Label Y</ylabel>
   17:     <curve linestyle="linespoints" name="My Plot" pointtype="0" color="x000000">
   18:         <data>@X</data>
   19:         <data>@Y</data>
   20:     </curve>
   21: </gnuplot>
   22: 
   23: <startouttext />
   24: What is the amplitude of this function?
   25: <endouttext />
   26: 
   27: <numericalresponse answer="$amplitude" format="2s">
   28:     <responseparam name="tol" type="tolerance" description="Numerical Tolerance" default="5%" />
   29:     <textline readonly="no" />
   30: </numericalresponse>
   31: 
   32: </problem>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>