[LON-CAPA-users] Publishing problem - version issue?

lon-capa-users@mail.lon-capa.org lon-capa-users@mail.lon-capa.org
Wed, 6 Dec 2006 15:50:37 -0500


Hi,

I have some problems that used to publish, but suddenly will not publish. I
have not made changes, and don't see anything obviously wrong, so I am
hoping 1) a fresh pair of eyes may see something, or 2) some change went in
with a recent software update that is incompatible with my problems. Or
something :)

The error message I get, when opening the library module in the XML editor,
is

ERROR:Found a <*response> outside of a <part> in a <part>ed problem

If I replace the <library> tag with <problem> (and the associated </library
with </problem), then it seems to work OK.

This only seems to happen in problems using the gnuplot responses.

I show the entire code below, sorry it is so long, but I don't want to
leave out some critical erroneous part.

Thanks for any help,
brew


problem question001.library:

<library>
<import id="501036"> ../../../Common/GraphicSetup.library </import>

<script type="loncapa/perl">
$yname="Displacement";
$yname2="Velocity";
$xname="Time";
</script>

 <startouttext />Which pair of graphs represents the same motion of an
 object?<endouttext />

   <radiobuttonresponse max="4" id="11" randomize="yes">
    <foilgroup>
      <foil location="random" value="true" name="foil0"><startouttext />
<gnuplot width="$gWidth" grid="on" align="center" font="small"
height="$gHeight" border="on" bgcolor="xffffff" fgcolor="x000000"
alttag="dynamically generated plot" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="0.0" xmax="1.0" />
     <ylabel>$yname</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <curve linestyle="lines" name="" color="xff0000" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@Y2</data>
     </curve>
 </gnuplot>

<gnuplot width="$gWidth" grid="on" align="center" font="small"
     height="$gHeight" border="on" alttag="dynamically generated plot"
     bgcolor="xffffff" fgcolor="x000000" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="0.0" xmax="1.0" />
     <ylabel>$yname2</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <curve linestyle="lines" name="" color="x0000ff" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@Y</data>
     </curve>
 </gnuplot>
 <p />
<endouttext /></foil>

   <foil location="random" value="false" name="foil1"><startouttext />
<gnuplot width="$gWidth" grid="on" align="center" font="small"
height="$gHeight" border="on" alttag="dynamically generated plot"
bgcolor="xffffff" fgcolor="x000000" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="-1.0" xmax="1.0" />
     <ylabel>$yname</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="1.0" increment="1.0"
     start="-1.0" />
     <curve linestyle="lines" name="" color="xff0000" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@YMinus</data>
     </curve>
 </gnuplot>

<gnuplot width="$gWidth" grid="on" align="center" font="small"
     height="$gHeight" border="on" alttag="dynamically generated plot"
     bgcolor="xffffff" fgcolor="x000000" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="0.0" xmax="1.0" />
     <ylabel>$yname2</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <curve linestyle="lines" name="" color="x0000ff" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@YFlat</data>
     </curve>
 </gnuplot>
 <p />
<endouttext /></foil>

   <foil location="random" value="false" name="foil2"><startouttext />
<gnuplot width="$gWidth" grid="on" align="center" font="small"
height="$gHeight" border="on" alttag="dynamically generated plot"
bgcolor="xffffff" fgcolor="x000000" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="0.0" xmax="1.0" />
     <ylabel>$yname</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <curve linestyle="lines" name="" color="xff0000" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@YDown</data>
     </curve>
 </gnuplot>

<gnuplot width="$gWidth" grid="on" align="center" font="small"
     height="$gHeight" border="on" alttag="dynamically generated plot"
     bgcolor="xffffff" fgcolor="x000000" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="-1.0" xmax="1.0" />
     <ylabel>$yname2</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="1.0" increment="1.0"
     start="-1.0" />
     <curve linestyle="lines" name="" color="x0000ff" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@YMinus</data>
     </curve>
 </gnuplot>
 <p />
<endouttext /></foil>

   <foil location="random" value="false" name="foil3"><startouttext />
<gnuplot width="$gWidth" grid="on" align="center" font="small"
height="$gHeight" border="on" alttag="dynamically generated plot"
bgcolor="xffffff" fgcolor="x000000" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="0.0" xmax="1.0" />
     <ylabel>$yname</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <curve linestyle="lines" name="" color="xff0000" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@YParab</data>
     </curve>
 </gnuplot>

<gnuplot width="$gWidth" grid="on" align="center" font="small"
     height="$gHeight" border="on" alttag="dynamically generated plot"
     bgcolor="xffffff" fgcolor="x000000" transparent="off">
     <axis xmin="0.0" ymax="1.0" color="xff0000" ymin="0.0" xmax="1.0" />
     <ylabel>$yname2</ylabel>
     <xlabel>$xname</xlabel>
     <xtics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <ytics location="border" mirror="on" end="4.0" increment="3.0"
     start="3.0" />
     <curve linestyle="lines" name="" color="x0000ff" pointtype="1"
     pointsize="1">
         <data>@X</data>
         <data>@YFlat</data>
     </curve>
 </gnuplot>
 <p />
<endouttext /></foil>
    </foilgroup>
   </radiobuttonresponse>

</library>



The included library is script library GraphicSetup.library:
<library>
<script type="loncapa/perl">
if (! exists $YSqrt[0])        # skip everything if it has already been
done
    {
    # Setup X and various useful Y datasets for making the little
    comparison graphs
    for ($x=0.0; $x<=1.0; $x+=0.01) {
        push @X,  $x;
        push @Y,  $x;
        push @YLess,  0.6*$x;
        push @YMinus,  $x - 0.5;
        push @Y2, $x*$x;
        push @YSqrt, &sqrt($x);
        push @YParab, 1 - 4*($x-0.5) * ($x-0.5);
        push @YParabDown, 1 -($x* $x) ;
        push @YDown, 1 - $x;
        push @YHyp, (1 / ($x+0.1)) * 0.1 ;
        push @YFlat, 0.75;
        if ($x < 0.4)
            {
            push @YSpecial, $x;
            }
        else
            {
            push @YSpecial, 0.4;
            }
    }
    $yname="Y";   # each graph should replace these
    $xname="X";
    $gWidth = &web (150,750,200);
    $gHeight = &web (150,250,150);
    }
</script>
</library>