<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.MsoChpDefault
        {font-family:"Calibri",sans-serif}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0" vlink="#954F72" lang="EN-US" link="#0563C1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br>
Hi Gene,<br>
<br>
Perhaps your problem is that you have <span lang="en-US"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt;"><block condition="status_a"> instead of
</span></font></span><span lang="en-US"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt;"><block condition="$status_a">. You are missing the $ sign.<br>
<br>
Yuk Tung Liu<br>
E-Learning Specialist <br>
Department of Statistics <br>
UIUC<br>
<br>
</span></font></span><br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF51770" style="direction: ltr;"><font size="2" face="Tahoma" color="#000000"><b>From:</b> LON-CAPA-users [lon-capa-users-bounces@mail.lon-capa.org] on behalf of Harding, Gene L [glhardin@purdue.edu]<br>
<b>Sent:</b> Friday, May 11, 2018 7:00 PM<br>
<b>To:</b> Discussion list for LON-CAPA users<br>
<b>Subject:</b> [LON-CAPA-users] Conditional Block Issue<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal">Hi, </p>
<p class="MsoNormal"> </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:</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</p>
<p class="MsoNormal" style="margin-left:.5in">$status_a = &check_status('a');</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</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Then I put the gnuplot code inside a conditional block:</p>
<p class="MsoNormal" style="margin-left:.5in"><block condition="status_a"></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"
</p>
<p class="MsoNormal" style="margin-left:.5in">         bgcolor="xffffff" fgcolor="x000000" alttag="Spectrum Plot" transparent="off" major_ticscale="2" plottype="Cartesian"></p>
<p class="MsoNormal" style="margin-left:.5in">    <xtics minorfreq="1" location="border" mirror="on" end="$xtic_stop" increment="$xtic_incr" start="0" /></p>
<p class="MsoNormal" style="margin-left:.5in">    <ytics minorfreq="1" location="border" mirror="on" end="20" increment="2" start="0" /></p>
<p class="MsoNormal" style="margin-left:.5in">    <axis xmin="$x_min" ymax="$y_max" color="x000000" ymin="$y_min" xmax="$x_max" /></p>
<p class="MsoNormal" style="margin-left:.5in">    <xlabel>Frequency (MHz)</xlabel></p>
<p class="MsoNormal" style="margin-left:.5in">    <ylabel>Amplitude (V)</ylabel></p>
<p class="MsoNormal" style="margin-left:.5in">    <curve linestyle="vector" linetype="solid" arrowangle="30" arrowstyle="filled" color="x000000" pointtype="4"
</p>
<p class="MsoNormal" style="margin-left:.5in">           linewidth="1" arrowhead="head" arrowlength="$arwhd" pointsize="1"></p>
<p class="MsoNormal" style="margin-left:.5in"><!-- vector plot requires 4 datasets: X, Y, deltaX, deltaY --></p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@f</data> </p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@tails</data> </p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@zeros</data> </p>
<p class="MsoNormal" style="margin-left:.5in">        <data>@mag</data> </p>
<p class="MsoNormal" style="margin-left:.5in">    </curve></p>
<p class="MsoNormal" style="margin-left:.5in"></gnuplot></p>
<p class="MsoNormal" style="margin-left:.5in"></block></p>
<p class="MsoNormal"> </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?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks for any help/advice you can provide.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Best regards,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="color:black">Gene L. Harding, PE</span></p>
<p class="MsoNormal"><span style="color:black">Associate Professor of ECET</span></p>
<p class="MsoNormal"><span style="color:black">574-520-4190</span></p>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</body>
</html>