---
metadata:
    display_name: Numerical Input
    markdown: |
       A numerical input problem accepts a line of text input from the student, and evaluates the input for correctness based on its numerical value.

       The answer is correct if it is within a specified numerical tolerance of the expected answer.

       >>Enter the numerical value of Pi:<<
       = 3.14159 +- .02
       
       >>Enter the approximate value of 502*9:<<
       = 4518 +- 15%

       >>Enter the number of fingers on a human hand<<
       = 5

       [explanation]
       Pi, or the the ratio between a circle's circumference to its diameter, is an irrational number known to extreme precision. It is value is approximately equal to 3.14.

       Although you can get an exact value by typing 502*9 into a calculator, the result will be close to 500*10, or 5,000. The grader accepts any response within 15% of the true value, 4518, so that you can use any estimation technique that you like.

       If you look at your hand, you can count that you have five fingers.
       [explanation]
data: |
   <problem>
   <p>
   A numerical input problem accepts a line of text input from the
   student, and evaluates the input for correctness based on its
   numerical value.  
   </p>

   <p>
   The answer is correct if it is within a specified numerical tolerance
   of the expected answer.
   </p>
   <script type="loncapa/python">
   computed_response = 502*9
   </script>

   <p>Enter the numerical value of Pi:
       <numericalresponse answer="3.14159">
           <responseparam type="tolerance" default=".02" />
           <formulaequationinput label="Enter the numerical value of Pi" />
       </numericalresponse>
   </p>
   <p>Enter the approximate value of 502*9:
       <numericalresponse answer="$computed_response">
           <responseparam type="tolerance" default="15%"/>
           <formulaequationinput label="Enter the approximate value of 502 times 9"/>
       </numericalresponse>
   </p>

   <p>Enter the number of fingers on a human hand:
       <numericalresponse answer="5">
           <formulaequationinput label="Enter the number of fingers on a human hand"/>
       </numericalresponse>
   </p>
       <solution>
           <div class="detailed-solution">
               <p>Explanation</p>
               <p>Pi, or the the ratio between a circle's circumference to its diameter, is an irrational number known to extreme precision. It is value is approximately equal to 3.14.</p>
               <p>Although you can get an exact value by typing 502*9 into a calculator, the result will be close to 500*10, or 5,000. The grader accepts any response within 15% of the true value, 4518, so that you can use any estimation technique that you like.</p>
               <p>If you look at your hand, you can count that you have five fingers.</p>
           </div>
       </solution>
   </problem>
