<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
h3
        {mso-style-priority:9;
        mso-style-link:"Heading 3 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:13.5pt;
        font-family:"Calibri",sans-serif;
        font-weight:bold;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.Heading3Char
        {mso-style-name:"Heading 3 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 3";
        font-family:"Calibri Light",sans-serif;
        color:#1F3763;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Arial",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Justin,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Many thanks!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">I will give it a try!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Grigory<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><b>From:</b> LON-CAPA-users <lon-capa-users-bounces@mail.lon-capa.org>
<b>On Behalf Of </b>Justin Gray<br>
<b>Sent:</b> Thursday, November 21, 2019 2:28 PM<br>
<b>To:</b> Discussion list for LON-CAPA users <lon-capa-users@mail.lon-capa.org><br>
<b>Subject:</b> Re: [LON-CAPA-users] Formula response won't recognize "pi"<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">You can evaluate the answer using Maxima and allow for a tolerance using mathresponse. In Maxima, the constant pi is written as %pi. Here is a possible coding for this problem, which will accept either %pi or a numerical approximation for
 pi:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><problem><br>
<script type="loncapa/perl"><br>
$function = "1/sqrt(4*(%pi)^2*L*C)";<br>
$answer=&xmlparse('The correct answer is <m eval="on">$\frac{1}{\sqrt{4\cdot\pi^{2} \cdot L\cdot C}}$</m>');<br>
</script><br>
<br>
<startouttext /><br>
    <p>Enter <m>$ \frac{1}{\sqrt{4\cdot\pi^{2} \cdot L\cdot C}} $</m></p><br>
<endouttext /><br>
<br>
<mathresponse answerdisplay="$answer" cas="maxima" args="$function"><br>
    <answer>is(abs((RESPONSE[1])/(LONCAPALIST[1]) - 1) < 0.01);</answer><br>
    <textline readonly="no" size="100" spellcheck="none" /><br>
</mathresponse><br>
</problem><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You will probably want to give students some instruction for formatting their answer.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Justin<br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:black">--<b><o:p></o:p></b></span></p>
<p style="line-height:13.5pt;margin:1rem 0px 1.5rem;font-stretch:normal"><b><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:black">Justin Gray</span></b><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:black"><br>
Senior Lecturer | Department of Mathematics<br>
Simon Fraser University | SCK 10531<br>
8888 University Dr., Burnaby, B.C. V5A 1S6<br>
T: 778.782.4237<o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<div>
<h3><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black;font-weight:normal"><img id="_x0000_i1025" src="https://www.sfu.ca/content/sfu/communicators-toolkit/tools/brand-tools/on-brand-templates/email-signature/jcr:content/main_content/image_0.img.1280.high.png/1527873607206.png"><o:p></o:p></span></h3>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Nov 21, 2019 at 11:14 AM H. K. Ng <<a href="mailto:hkng@fsu.edu">hkng@fsu.edu</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Formularesponse using  cas with maxima works great. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><problem><br>
<script type="loncapa/perl"><br>
$ansa  = &cas('maxima','1/sqrt(4*pi^2*L*C)');<br>
</script><br>
<br>
<startouttext />What is formula for resonant frequency for an LC circuit? <endouttext /><br /><br>
<br>
<startouttext /><m>$ \omega_{res} = $</m><endouttext /><br>
<formularesponse answer="$ansa" id="12"><br>
    <textline readonly="no" /><br>
</formularesponse><br>
<br>
</problem><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">-hk<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Nov 21, 2019 at 11:05 AM SIMIN, GRIGORY <<a href="mailto:SIMIN@engr.sc.edu" target="_blank">SIMIN@engr.sc.edu</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p>Hi all!<o:p></o:p></p>
<p><span style="color:black">I've found a strange issue in some problems requiring formula response.</span><o:p></o:p></p>
<p><span style="color:black">I have a simple question to enter the formula for the resonant frequency.</span><o:p></o:p></p>
<p><span style="color:black">An example of correct answer is (in other variations the formula could be a bit more complex than this one)</span><o:p></o:p></p>
<p><span style="color:black">1/(2*pi*sqrt(L*C))</span><o:p></o:p></p>
<p><span style="color:black">The correct solution is checked by sampling L and C values.</span><o:p></o:p></p>
<p><span style="color:black">When I am entering the answer, I can see that LON-CAPA recognizes it because it displays the formatted formula as I am entering it:</span><o:p></o:p></p>
<p><span style="color:black"><img border="0" width="429" height="119" style="width:4.4666in;height:1.2416in" id="gmail-m_-3309117221527511361gmail-m_-4797884704070664240Picture_x0020_1" src="cid:image001.jpg@01D5A07B.3EF6C940"></span><o:p></o:p></p>
<p><span style="color:black"> </span><o:p></o:p></p>
<p><span style="color:black">But when I press submit, I got the response:</span><o:p></o:p></p>
<p><span style="color:black">“unable to understand formula”</span><o:p></o:p></p>
<p><span style="color:black"> </span><o:p></o:p></p>
<p><span style="color:black">By experimenting with this, I found that the issue happens because of “pi” being a part of the answer.</span><o:p></o:p></p>
<p><span style="color:black">If pi is replaced with 3.141, everything would work.</span><o:p></o:p></p>
<p><span style="color:black">But it feels weird asking students to enter 3.141 instead of pi; besides, I don’t even want to give them a hint that pi is a part of the answer.
</span><o:p></o:p></p>
<p><span style="color:black"> </span><o:p></o:p></p>
<p><span style="color:black">Why is this happening? Apparently LON-CAPA knows what “pi” means because it displays it correctly.</span><o:p></o:p></p>
<p><span style="color:black"> </span><o:p></o:p></p>
<p><span style="color:black">Thanks!</span><o:p></o:p></p>
<p><span style="color:black">Grigory</span><o:p></o:p></p>
<p><span style="color:black"> </span><o:p></o:p></p>
<p><span style="color:black"> </span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
LON-CAPA-users mailing list<br>
<a href="mailto:LON-CAPA-users@mail.lon-capa.org" target="_blank">LON-CAPA-users@mail.lon-capa.org</a><br>
<a href="https://protect2.fireeye.com/v1/url?k=6499aa89-3808573f-6499e448-ac1f6b0e677a-e27f754950e6e6ab&q=1&e=55c490c3-9646-4121-955b-613377a7fa5e&u=https%3A%2F%2Furldefense.com%2Fv3%2F__http%3A%2F%2Fmail.lon-capa.org%2Fmailman%2Flistinfo%2Flon-capa-users__%3B%21%21PhOWcWs%21npThfddABuFrPgPy2N5gLLGz_02Hs0mlKSiyGgd0QGK0jAvPgqAmVRpO7BG6%24" target="_blank"><font color="red"><b>MailScanner has detected a possible fraud attempt from "protect2.fireeye.com" claiming to be</b></font> https://urldefense.com/v3/__http://mail.lon-capa.org/mailman/listinfo/lon-capa-users__;!!PhOWcWs!npThfddABuFrPgPy2N5gLLGz_02Hs0mlKSiyGgd0QGK0jAvPgqAmVRpO7BG6$</a>
<o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>