I don't see the script, but you need to have a tolerance. When the value is not specified, it defaults to an absolute tolerance of zero. If a floating point calculation is done, it will never be exactly an integer. From the author manual:
A tolerance parameter determines how closely the system will require the student's answer to be in order to count it correct. The tolerance will default to zero if it is not defined. The tolerance parameter should always be defined for a numerical problem unless you are certain only integer answers are generated from your script and you want students to reply with exactly that integer. If the computer answer is a floating point number, the tolerance should not be zero. Computers can only approximate computations involving real numbers. For instance, a computer's [decimal] answer to the simple problem 1 3 is "0.33333333333333331". It should be an infinite series of 3's, and there certainly shouldn't be a "1" in the an- swer, but no computer can represent an infinitely long, infinitely detailed real number. Therefore, for any problem where the answer is not an integer, you need to allow a tolerance factor, or the students will find it nearly impossible to exactly match the computer's idea of the answer. You may find the default tolerance too large for some problems, so adjust as appropriate. Hm, I think that last line should say "if you use the colorful editor tolerance template, the default tolerance may be too large...". I think the template defaults to 5%. the format affects the display, not the calculations. From: lon-capa-users-boun...@mail.lon-capa.org [mailto:lon-capa-users-boun...@mail.lon-capa.org] On Behalf Of Harding, Gene L Sent: Tuesday, January 24, 2017 8:23 AM To: Discussion list for LON-CAPA users <lon-capa-users@mail.lon-capa.org> Subject: Re: [LON-CAPA-users] Unordered Response Question Error Hi Carl, The ! was commenting out the parameter, something I tried among several permutations of syntax hoping to get something to work. The error message is the same whether it is there or commented out. I originally also had a sig figs param in it, but deleted it. I think that eliminated one error. I have tried putting the unit= and format= in the answer and value fields, but no luck there, either. Gene L. Harding, PE Associate Professor of ECET 574-520-4190 Purdue University-South Bend From: lon-capa-users-boun...@mail.lon-capa.org <mailto:lon-capa-users-boun...@mail.lon-capa.org> [mailto:lon-capa-users-boun...@mail.lon-capa.org] On Behalf Of Carl Lira Sent: Monday, January 23, 2017 11:22 PM To: 'Discussion list for LON-CAPA users' <lon-capa-users@mail.lon-capa.org <mailto:lon-capa-users@mail.lon-capa.org> > Subject: Re: [LON-CAPA-users] Unordered Response Question Error not sure of the impact of the ! in the responseparam field. I believe you should have some tolerance if you have a calculated real number, e.g. <responseparam name="tol" type="tolerance" default="2%" description="Numerical Tolerance" /> From: lon-capa-users-boun...@mail.lon-capa.org <mailto:lon-capa-users-boun...@mail.lon-capa.org> [mailto:lon-capa-users-boun...@mail.lon-capa.org] On Behalf Of Harding, Gene L Sent: Monday, January 23, 2017 10:00 PM To: 'lon-capa-users@mail.lon-capa.org' <lon-capa-users@mail.lon-capa.org <mailto:lon-capa-users@mail.lon-capa.org> > Subject: [LON-CAPA-users] Unordered Response Question Error Hi, I am trying to embed some unordered numericalresponse parameters inside an xml table. I modeled my xml after the example in LON-CAPA, but am having two problems with it. The first problem is an error referring to tolerance range, and the second is incompatible units. This is a screenshot: This is the code I am using: <startouttext /> A $Pa dBm, $fa-MHz RF input signal and a $Pb dBm, $fb-MHz LO signal are applied to a nonlinear mixer with $Zin-Ω impedance. Complete the table of IF cross products for m,n equal 1,2. <! Display numeric response inside a table > <table style="width:400px" border="1" cellpadding="1" > <tr> <td> m </td> <td> n </td> <td> |mf<sub>a</sub> ± nf<sub>b</sub>| </td> <td> Cross Products </td> </tr> <tr> <td>1</td> <td>1</td> <td> <numericalresponse format="0f" unit="MHz" id="11"> <answergroup type="ordered"> <answer type="unordered"> <value>$fa</value> <value>$fb</value> </answer> </answergroup> <!responseparam name="tol" type="tolerance" default="0" description="Numerical Tolerance" /> <textline size="8" readonly="no" /> <textline size="8" readonly="no" /> </numericalresponse> </td> <td>$f11_1 MHz $f11_2 MHz</td> </tr> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>2</td> <td>1</td> </tr> <tr> <td>2</td> <td>2</td> </tr> </table> <endouttext /> Any ideas why I am getting these two errors? Thanks for any advice you can provide. Best regards, Gene L. Harding, PE Associate Professor of ECET 574-520-4190 Purdue University-South Bend
_______________________________________________ LON-CAPA-users mailing list LON-CAPA-users@mail.lon-capa.org http://mail.lon-capa.org/mailman/listinfo/lon-capa-users