[LON-CAPA-users] FW: Rounding Issue

Harding, Gene L glhardin at purdue.edu
Sat Sep 21 20:51:11 EDT 2019


Hi everyone,

I have a quiz problem in LC that seems to be doing some odd things with the rounding. I have successfully recreated the problem reported by one of my students, but cannot figure out why it happens.

The answer to the problem (part c) is 2.65 on the dot. The problem requests an answer with one place after the decimal, and the tolerance is +/- 0.05. In this case, since the value computes to exactly 2.65, LC should take anything from 2.6 to 2.7. In fact, in author view LC indicates it will take anything from 2.6 to 2.7:
[cid:image002.jpg at 01D570BD.B3DBBD30]

The trouble is that 2.6 works, 2.65 works, but 2.7 does not.

This is the Perl script calculation (Rf=33, Ri=20):
$Av         = 1+$Rf/$Ri;           # Gain

This is the response code:
<numericalresponse unit="" format="1f" answer="$Av" id="3">
        <responseparam name="tol" type="tolerance" default="0.05" description="Numerical Tolerance" />
        <textline readonly="no" spellcheck="none" />
</numericalresponse>

Any idea what the problem is? I am baffled.

Best regards,

Gene L. Harding, PE
Associate Professor of ECET
Purdue University
574-520-4190
https://polytechnic.purdue.edu/south-bend/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20190922/be1d7f80/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 4325 bytes
Desc: image002.jpg
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20190922/be1d7f80/attachment-0001.jpg>


More information about the LON-CAPA-users mailing list