<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am trying to display something (a gnuplot) only if the student has exceeded the maxtries for a problem and not gotten it correct. I used the following code in the perl script to check the problem status and set a flag ($status_a) to zero
 only if maxtries is exceeded:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"># Check status: 'undef'=not attempted; 0=wrong but tries left; 1=correct; 2=maxtries exceeded; 3=after answer date<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">$status_a = &check_status('a');<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">if ($status_a ne 2) {$status_a=0;}  # If maxtries not reached, set to 0 so conditional block does not execute<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Then I put the gnuplot code inside a conditional block:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><block condition="status_a"><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><gnuplot width="700" minor_ticscale="0.75" grid="off" align="right" font="9" height="500" border="on" samples="100"
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">         bgcolor="xffffff" fgcolor="x000000" alttag="Spectrum Plot" transparent="off" major_ticscale="2" plottype="Cartesian"><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">    <xtics minorfreq="1" location="border" mirror="on" end="$xtic_stop" increment="$xtic_incr" start="0" /><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">    <ytics minorfreq="1" location="border" mirror="on" end="20" increment="2" start="0" /><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">    <axis xmin="$x_min" ymax="$y_max" color="x000000" ymin="$y_min" xmax="$x_max" /><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">    <xlabel>Frequency (MHz)</xlabel><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">    <ylabel>Amplitude (V)</ylabel><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">    <curve linestyle="vector" linetype="solid" arrowangle="30" arrowstyle="filled" color="x000000" pointtype="4"
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">           linewidth="1" arrowhead="head" arrowlength="$arwhd" pointsize="1"><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><!-- vector plot requires 4 datasets: X, Y, deltaX, deltaY --><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@f</data> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@tails</data> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@zeros</data> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@mag</data> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">    </curve><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"></gnuplot><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"></block><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I thought conditional blocks were skipped if the condition was zero, and executed for nonzero values, but the block is executing even when $status_a is zero. Can anyone see what I am doing wrong? Is there a better/easier way to do this?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for any help/advice you can provide.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:black">Gene L. Harding, PE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Associate Professor of ECET<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">574-520-4190</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>