(Answer) (Category) LON-CAPA User Help : (Category) Authoring : (Category) Authoring Problems :
How can I use the quantity "pi" in a formularesponse?
Define "pi" as a variable in the expression, but evaluate it at only 
one value, equal to the Perl variable "$pi".

Example:

<problem>
   <startouttext />
<p>What is the area of a circle w.r.t. the radius, r.</p>
   <endouttext />
   <formularesponse samples="pi,r@$pi,.1:$pi,5.#1,10" answer="pi*r^2">
   <responseparam name="tol" type="tolerance" default="0.01"
description="Numerical Tolerance" />
       <textline readonly="no" size="25" />
<hintgroup showoncorrect="no">
   <startouttext />You need to include &pi; in your response.<br />
Try "pi".<endouttext />
</hintgroup>

   </formularesponse>
</problem>


See the online contextual help for formularesponse in CSTR Edit mode
for the syntax of the argument 'samples'.
batchelo@sfu.ca
[Append to This Answer]
Previous: (Answer) multiple correct answers for String Response problems using Regular Expressions
Next: (Answer) New Item
This document is: http://help.loncapa.org/cgi-bin/fom?file=361
[Search] [Appearance] [Show This Answer As Text]
This is a Faq-O-Matic 2.719.
This FAQ administered by the LON-CAPA team at MSU. Submit a help request ticket to contact us.